Audio Issue - fails to play small simple sound

I have an app built for iOS and Android. First time I am building an app for both. Usually I have only done apps for ios. So there may be something I am not aware of when doing Android apps.

During a very simple action in the game (nothing that would overwhelm the processor), on the Android it fails to play the simple short sound effect (1 second length) 576kb size. But, it plays it every time repeatedly on the apple devices.

I tested it as a .wav  and as an mp3. It plays every time on the iOS devices (older iPad 2 and iPhone 6S plus), but not on the Android devices.

There is no reason that I can think that it should play on the iOS and not the Android.

I tested on a older HTC601 (KitKat) Android, then thinking the older android software could be issue, bought a brand new Moto G5plus (Nougat) … same issue.

There is no memory leak issue and the code is identical for both builds.  Checked and there are many sound channels available at the time.

Thanks for any suggestions possible.

Bob

How short is the sound? I’ve had the attack portion of some sounds removed on some devices. It’s only a couple of milliseconds of audio that disappears, but if the sound is really short it can “disappear”.

Try testing with a longer sound, maybe.

Also: the sound is preloaded into memory, right?

Thomas,

Thanks. Very good thought, and that made such sense to me, I immediately tested that. I really thought that was going to be the answer.  But that turns out not to be it, in my app. 

I had got to be so focused that the issue was with the older android being the issue, then maybe the android software, and I ended up  spending the good part of 2-3 days messing around trying to fix the issue.  But, your suggestion got me focused on the file itself, which turned out to be the right focus.

I tried many ideas troubleshooting this. I did a lot of testing over a couple of days, but once I was focused on the actual file I finally got to the solution. Having it work on the older iOS devices was very deceptive to the troubleshooting process.  I fixed it when I took these 5 or so sounds that were failing and opened each into Audacity, and just exported them as 16-bit PCM wav files. And now they play.  

The one mp3 file that failed on the android when I was testing early on,  directed me to think it was not the file itself, since both the wav and mp3 failed.  So I think that particular file failed for some other reason. I know it failed on the Android, and I do not remember if I tried it on the Ipad/Iphone.

It is strange to me that one of the newer Androids(Moto G5 plus) with Android Nougat would not play those sounds as 32-bit wav, but my very old iPad 2 can. 

Thanks for your help.

@Rob Miracle,

I am not absolutely sure that the actual issue is 32 vs 16 bit wav files on the android… but then again, maybe it is an issue.  Not sure if Corona can experiment and see if there are issues using 32 bit wav files on the Androids.  

Maybe I have something wrong in my setup, but I do know that as soon as I changed those audio files that had failed to play from 32 wav  to 16 wav they worked.  I read over the documentation for audio in the documentation section on the corona website, but I did not see anything where it noted that if using 32 bit wav files, they may not play on androids.  I guess because I have only done apps on iOS I have never ran into this issue.

If this 32 v 16 wav is an issue, maybe a ‘gotcha’ comment in the documentation on audio, could be helpful.

Of course, there could be something in the corona audio documentation already, and maybe I just did not see it. If so, please accept my apologize for not being more thorough in my research.

Thanks

Bob

How short is the sound? I’ve had the attack portion of some sounds removed on some devices. It’s only a couple of milliseconds of audio that disappears, but if the sound is really short it can “disappear”.

Try testing with a longer sound, maybe.

Also: the sound is preloaded into memory, right?

Thomas,

Thanks. Very good thought, and that made such sense to me, I immediately tested that. I really thought that was going to be the answer.  But that turns out not to be it, in my app. 

I had got to be so focused that the issue was with the older android being the issue, then maybe the android software, and I ended up  spending the good part of 2-3 days messing around trying to fix the issue.  But, your suggestion got me focused on the file itself, which turned out to be the right focus.

I tried many ideas troubleshooting this. I did a lot of testing over a couple of days, but once I was focused on the actual file I finally got to the solution. Having it work on the older iOS devices was very deceptive to the troubleshooting process.  I fixed it when I took these 5 or so sounds that were failing and opened each into Audacity, and just exported them as 16-bit PCM wav files. And now they play.  

The one mp3 file that failed on the android when I was testing early on,  directed me to think it was not the file itself, since both the wav and mp3 failed.  So I think that particular file failed for some other reason. I know it failed on the Android, and I do not remember if I tried it on the Ipad/Iphone.

It is strange to me that one of the newer Androids(Moto G5 plus) with Android Nougat would not play those sounds as 32-bit wav, but my very old iPad 2 can. 

Thanks for your help.

@Rob Miracle,

I am not absolutely sure that the actual issue is 32 vs 16 bit wav files on the android… but then again, maybe it is an issue.  Not sure if Corona can experiment and see if there are issues using 32 bit wav files on the Androids.  

Maybe I have something wrong in my setup, but I do know that as soon as I changed those audio files that had failed to play from 32 wav  to 16 wav they worked.  I read over the documentation for audio in the documentation section on the corona website, but I did not see anything where it noted that if using 32 bit wav files, they may not play on androids.  I guess because I have only done apps on iOS I have never ran into this issue.

If this 32 v 16 wav is an issue, maybe a ‘gotcha’ comment in the documentation on audio, could be helpful.

Of course, there could be something in the corona audio documentation already, and maybe I just did not see it. If so, please accept my apologize for not being more thorough in my research.

Thanks

Bob