Audio problen android

Hello, I’m having problems with sound reproduction, I have a slight delay in the sounds, I only happen in Android in Ios is perfect.

The tests are done in physical device, and I use the library of audio for the reproduction of the sounds

Do you know why the sound is delayed? Is there any solution?

Thank you.

This is a very common and frustrating problem. Android versions before 5.1 (maybe 5.2) had an issue with their implementation of the OpenAL library and the result was delayed playback of audio. Google allegedly fixed this in later versions of Android (5.2 + ), however I think there is still some delay there.

If you have time critical sounds, you should use the media.newEventSound() API https://docs.coronalabs.com/api/library/media/newEventSound.html

This of course has it’s own drawbacks. You can only play one at a time, so it’s best for short sounds. You may find this frustrating if you’re building a space shooter and you have sound for your blasters and a sound for your explosions for instance. If you’re planning on supporting Android builds older than 5.2, you may need to go this route.

Rob

Perfect, thank you very much try to do more tests on different android devices

This is a very common and frustrating problem. Android versions before 5.1 (maybe 5.2) had an issue with their implementation of the OpenAL library and the result was delayed playback of audio. Google allegedly fixed this in later versions of Android (5.2 + ), however I think there is still some delay there.

If you have time critical sounds, you should use the media.newEventSound() API https://docs.coronalabs.com/api/library/media/newEventSound.html

This of course has it’s own drawbacks. You can only play one at a time, so it’s best for short sounds. You may find this frustrating if you’re building a space shooter and you have sound for your blasters and a sound for your explosions for instance. If you’re planning on supporting Android builds older than 5.2, you may need to go this route.

Rob

Perfect, thank you very much try to do more tests on different android devices