Sound partially stops working on iPad after a while

I am still trying to isolate this problem. After a while of playing my game on an iPad (iOS 5.1.1, Corona Build 840), some of the audio stops working (all using audio.play()). While some of the sounds continue to work, others do not. The audio handles are cached once loaded.

This has nothing to do with suspend/resume. I simply play the game for an 30+ minutes and then the issue shows up.

Any know issues that might explain this behavior?

Thanks,
Mike [import]uid: 101075 topic_id: 28389 reply_id: 328389[/import]

There are no known issues I’m aware of. Do you see any messages in Xcode console (if connected to your Mac).

You didn’t post any code showing how you are managing the audio but my guess is you are running out of audio buffers. I’m assuming you are using audio.loadStream. Is the audio file that’s failing longer than 30 minutes or are you restarting a shorter sound file? If it’s a shorter sound file are you rewinding it or calling audio.dispose?

-Tom [import]uid: 7559 topic_id: 28389 reply_id: 114623[/import]

All the audio uses audio.loadSound() and all are short (a few seconds at most) and most need to be shared. I have not been using rewind or dispose. The sound handles are all cached by the game as they are reused all the time, so dispose is never used. I will look into using rewind() as part of the onComplete handling.

Thanks for the ideas.

Mike

FWIW, I am using Corona Build 840 and the documentation does not agree with how audio.rewind works. I followed the documentation to pass a table with a key of ‘channel’ and got this error:
[blockcode]
Runtime error
attempt to index a nil value
stack traceback:
[C]: ?
[C]: in function ‘rewind’
[/blockcode]

The error message goes away if I simply pass the channel. There does not appear to be a way to verify the position after the rewind, so I assume it is working. [import]uid: 101075 topic_id: 28389 reply_id: 114663[/import]