Problems with Audio on Android since yesterday

Just for educational purposes… yes audio.play() will find a free channel but that might find a free “reserved” channel that you have set up for other purposes with different configuration.

For example, I reserve the first 5 channels for music but not all channels may be playing at the point I call audio.play() so therefore Corona might assign channel 3 when I don’t want it to.

I post code, not just for you, but for others too.

P.S. with a complicated audio setup it is always best practise to set your audio levels before loading sounds or streams.

It will NOT find a free channel that is also a reserved channel-- that is the very purpose of reserving channels. You example, as far as the API documentation goes, is wrong.  https://docs.coronalabs.com/api/library/audio/reserveChannels.html

You’re also quite welcome to post snippets of code for the community’s benefit-- never said you didn’t need to post the code that you did-- only responded to you based on the nature of the specific problem being discussed on the thread. 

You are correct with regard to the API… but I said _ “reserved” _ meaning a soft reserve not a hard reserve - via reserveChannels()

Yes, audio.play() should find a free channel. But that doesn’t mean that the OpenAL code on the particular device you’re testing on doesn’t have a bug in it’s library. Sometimes fixing bugs means working around them in particular in the Android world where you’re trying to run on 12 different operating system versions.

My advice is to find a free channel, make sure it’s not 0, and if so play your sound on that specific channel and don’t just blindly use the return value from audio.play.  

Rob

Wasn’t a problem with one device but with android builds running across 10-12 different devices and different versions of the Android OS. Anyway, as I said in an earlier post-- turned out to be the sound clip which was causing the behaviour. Marking as solved.