audio.loadStream() more resource intensive? Any way to increase buffer size?

I changed my background music from the previous system to the new audio.loadStream() and found the results unacceptable. Massive skipping when starting the game and in other parts, that used to work fine before. I know it's best efforts and all, but is there any way to get it to be more consistent, like a longer buffer before it starts playing?

As it is now I had to switch to audio.loadsound even for music file, which adds a little to the initial loading times, but works flawlessly during gameplay.

On a related note. I had a button to stop the music on channel 1 (audio.stop(1)) and then another button to get it to play again. But it didn't work until I also added an audio.stop(1) to the second button (the first button WAS stopping the sound btw). I found it really weird, but the workaround worked well enough.

Can you tell me a little more about your program?

First, are you running on iOS or Android? If on iOS, do you see this problem on all devices, or only slower devices? Do you see this problem in the Xcode or Corona simulators?

Second, what kind of audio file are you using? What container (.caf, .mp4, .ogg, etc)? What codec (aac, mp3, etc)? What properties does it have, e.g. (44kHz, stereo)?

Third, is your program CPU intensive before you add audio? Do you know where your bottlenecks are? (Instruments might help you find out.)

Fourth, are you trying to stream multiple audio files simultaneously? If so, does changing the codec type from something like mp3/aac to linear pcm (wav) make things run better?

For your audio.stop() problem, I'm not sure what's going on there. But that shouldn't happen. Can you submit a simple reproducible test case for us?

I'm running iOS. I saw the problem on iphone 4, didn't need to test further. Like I said the old audio engine had no performance issues (it had other issues like volume not working all the time, etc.). The problems are mostly at the start when OpenFeint is loading and on the gameover screen when the music starts playing again.

I'm using aac. I was using mp3 on the previous engine, but I changed it. I'm not sure on the specifications on the file (so that should tell you plenty about how optimized it is). I was only streaming one file at a time.

I'll see about reproducing the audio.stop issue, though that's for audio.loadSound. Since the performance problems I'm not using streaming anywhere in my game anymore and I'm putting up with a little longer load times at the start.

IgnacioIturra, I sent you an offlist-email. Please let me know if you received it.

I got it, thanks. Unfortunately I'm pretty busy with real work, so I don't have time to look into it today. I just wanted to get my binary resubmitted to Apple today and be done with that.

I'll try to take a look tomorrow and let you know. Thanks.

I too have noticed this.

The best way to see the choppyness is to be playing an mp3 and open Open Feint and go the the ad screen, bottom right button. As this loads it stresses the system, the mp3 starts to skip and it never recovers.

Matt

views:1448 update:2011/10/5 8:48:05
corona forums © 2003-2011