Audio issues since release 268

@ewing

Thanks for your prompt reply. I am using the exact method you are mentioning, pause and resume. It seems to be better now that I optimized performance a bit in my application. I will submit what I have as soon as I can so that you can have a look.

It seems that seems 268 I am really riding on the edge of having the audio stutter. Any performance tip regarding audio you would recommend besides the ones that are in the documentation?

My game is synched with music, and although you someone at ansca has mentioned before that Corona does not yet have that type of precision. I am managing all right as long as the audio doesn’t skip and I can pause and resume exactly from the same spot.

I was thinking about giving some time to get back up and running at resume time. I really don’t know what is involved during this process, so I don’t know how much time would be necessary. Few milliseconds or 4 seconds? Any suggestion is welcome.

Thanks again for your help. [import]uid: 8192 topic_id: 6165 reply_id: 39042[/import]

Most of the performance tuning is in the audio notes.

And as I said, you are on an edge case, so you are kind of a pioneer on this. Waiting before you resume might help, but I’m not sure how long you need. It also really depends on what’s causing the stuttering. If your CPU is bogged down doing other non-audio things trying to resume, then waiting until that is done will help.

However, if your bottleneck is only audio, then (assuming you are streaming), in addition to things like mono and using lower frequencies, you could try playing with different encoding formats. For example, try AAC which Apple’s hardware decoder is probably the most optimized for. Or conversely, maybe the hardware decoder is what the problem is in which case try IMA4 (in a .CAF container) or possibly even WAV (though I think IMA4 is your better bet).

If you saw the Yobonja post about the secret audio APIs (http://developer.anscamobile.com/forum/2011/05/25/hidden-audio-module-corona-sdk
), there are actually really hidden APIs they didn’t find to fine tune streaming parameters, but I’m not sure they actually useful in this background resume case. I’m hesitant to talk about those streaming ones because I’m still planning to do additional changes in the backend which will potentially break people who use those.
[import]uid: 7563 topic_id: 6165 reply_id: 39062[/import]

@ewing - hi, and thanks for all the help you supply on this forum…

I’m new to Corona (this week), and my first app is, apparently, running into these issues in your new audio API. The onComplete event logic isn’t working in my code (where I am trying to audio.play a series of sounds individually and in succession).
I chose to use the new API, as it’s…well…new, as is my app. :slight_smile:

The problem is, your fixes are only being published to the daily builds, and I just downloaded (and am trialing) Corona as of
Monday this week (build 2011.505 2011/04/12).

I don’t plan to purchase until I’ve seen what I can do with it,
and have built a saleable app with it. So, you can see my problem, and probably guess my question:

When do you expect the latest audio fixes will be posted to the
publicly available download? Under conditions like these (ie:
major subsystem operability fixes being added), how often do
you guys normally update the public download?

TIA,
xnology [import]uid: 64699 topic_id: 6165 reply_id: 39285[/import]

It’s hard to predict when our next formal release will be. We put a lot more manual testing into formal releases which is why they happen less frequently. Daily builds are a benefit of subscribing.

If you want to work-around the problem, if I recall correctly, the bug was a race condition in recycling the channel before the callback had fired. If true, then one work-around would be to not use automatic channel assignment and manage your own channel assignments. Keep a circular array of free channels and grab the least recently used channel which should minimize this race condition. Alternatively, you could manually query channels to see if they are done playing. You could periodically poll in enterFrame listeners or if you know the length of the audio, set your own timer callbacks to fire shortly after you expect the sound to finish playing to handle clean up.

That said, this bug should happen infrequently. It’s annoying yes, but for just getting started, I’m surprised you are hitting this bug in a way that really matters. I should probably ask to make sure you are using the API correctly. You should get onComplete callbacks 98% of the time even with the bug there. (The old audio/media API is completely broken though and is easy to create situations where you get no callbacks.)
[import]uid: 7563 topic_id: 6165 reply_id: 39369[/import]

I am using the new API, and have checked for typos and mistakes (multiple times…even re-writing). It’s simply missing the
onComplete events.

Thanks for the response to the update questions, though I don’t
really see the reasoning why you should make daily builds
a “benefit” of subscribing. Subscribing simply gives you the
only means of marketing your app (paid OR free), and a few *real*
benefits such as exclusive content and pre-release stuff.

I can buy the idea of “bug reporting” for subscribers only
(though I would suggest deprecating this policy also), but
only as a means of increasing the likeliness of “valid” bug
reports…not so much as a benefit to subscribers, as a benefit
to your support people.

But daily builds surely ought to be available for free and
paid Corona users alike. What harm does that possibly do?
What good does the converse do? It’s not like subscribers are
going to feel “privileged” being the only ones getting timely
fixes. And “daily updates for all” only furthers ANSCA’s reasons
for having a free install in the first place…to get new PAYING
customers…let them “trial it out.” I, for one, am not seeing
the “no daily updates” as a good thing, being a potential (and
indeed LIKELY) subscriber, as it is inhibiting my ability to test
and build an app. Please consider re-thinking this policy. Does
it do ANY good, and even if so, does it not do more HARM than
GOOD?

Seriously, is it really necessary and good?

These are just my idea of helpful suggestions. I like much of
the concept behind the product (though I’m not a LUA fan, but
then I’m not a Mac fan either :slight_smile: ). Nevertheless, I want to
reiterate how much I appreciate you guy’s *great* start to a
*great* product. I will no doubt be using it happily, and have
already recommended it, despite my current difficulties…

Thanks again!
[import]uid: 64699 topic_id: 6165 reply_id: 39371[/import]

@ewing - I apologize about the above…I guess I got just a bit
off topic on most of the post. :slight_smile: [import]uid: 64699 topic_id: 6165 reply_id: 39372[/import]

the onComplete audio is fixed internally and should make it to daily build any day.

@xnology6 but please let me know how you really feel about dailybuilds for subscribers only. :wink:

carlos [import]uid: 24 topic_id: 6165 reply_id: 39380[/import]

@ewing Please look at this case #6372. Shows the issue with pause and resume. [import]uid: 8192 topic_id: 6165 reply_id: 41467[/import]

Should be fixed in today’s daily build. [import]uid: 7563 topic_id: 6165 reply_id: 41607[/import]

I started using Corona SDK this weekend. I have some sample code I’m working with on Windows and my code works as expected on the DROID Corona Simulator, BUT when I moved my code over onto my Mac OS X and then attempted to run the same code on the iPhone Corona Simulator, audio issues started occurring.

Specifically, when I attempt:

audio.play(balloonPopAudio)

no audio is heard. This is a very short .mp3 audio file so I have been reading that short audio files do not work (or people have had issues in the past). But then I also notice that if I execute:

audio.stop(x)
audio.play(y)

the stop function appears to impede the execution of the audio.play

It’s obviously not good to have simulators that run inconsistently across platforms. Is this a known issue and is there a workaround? I was very excited about this SDK and was about to buy the Pro package, but now I’m concerned. Please and thank you.

COMMENT: I determined my issue was a Windows/Mac OS inconsistency whereby my filename string was incorrect; balloonPop.mp3 works on Windows but NOT on Mac if the ACTUAL filename is capital (BalloonPop.mp3). I did convert the file to .wav and it seems to play, but I’m not sure an .mp3 wouldn’t work now too. [import]uid: 74844 topic_id: 6165 reply_id: 44676[/import]

“Free” version still not been updated with fixes… [import]uid: 64699 topic_id: 6165 reply_id: 44711[/import]