Supported audio format on Android and iOS

I am developing a cross-platform business app which needs to be able to play an audio sample, provided by an API call to the clients server, which is an 8-bit WAV file at 11,025Hz sample rate. The plays OK on iOS but not an Android device (specifically a Nexus 7 so far).

The Corona documentation says:

  • Cross-platform  .wav  files must be 16-bit uncompressed

So I assumed this was an Android limitation, however my client says that their tests show that the audio works on an Android device. Google’s documentation states:

http://developer.android.com/guide/appendix/media-formats.html

  • PCM/WAVE
    (Android 4.1+)
  • 8- and 16-bit linear PCM (rates up to limit of hardware). Sampling rates for raw PCM recordings at 8000, 16000 and 44100 Hz.
  • WAVE (.wav)

… which doesn’t explicitly say that 11,025Hz is supported or not (as I’m not sure we’re dealing with linear or raw PCM data).

 

Can anyone shed any light on this? If it is a Corona limitation, rather than Android, then I’ve got real problems as the existing audio format is specified elsewhere in the clients systems.

Stefan

Hi Stefan,

Which Android device is it successfully playing on? And which OS version? Can you collect some data and report back?

Thanks,

Brent

Hi Brent

My client tested it on a Samsung Galaxy S3 with Android 4.4 in a native app and it works. My Corona app has so far been tested on a Nexus 7 with Android 4.4.4, and a Samsung Galaxy S4 (not sure which version of Android but assume the stock one) which both emit sound but it is distorted and garbled. I should have feedback on a Kindle Fire build later today.

Stefan

I have found a work-around which is to load the audio file into a web view, Not very elegant but you do at least get an audio controller and it works (on S4, Nexus 7 and Kindle Fire) so it must be a Corona issue rather than specific to the Android OS.

Hi Stefan,

Which Android device is it successfully playing on? And which OS version? Can you collect some data and report back?

Thanks,

Brent

Hi Brent

My client tested it on a Samsung Galaxy S3 with Android 4.4 in a native app and it works. My Corona app has so far been tested on a Nexus 7 with Android 4.4.4, and a Samsung Galaxy S4 (not sure which version of Android but assume the stock one) which both emit sound but it is distorted and garbled. I should have feedback on a Kindle Fire build later today.

Stefan

I have found a work-around which is to load the audio file into a web view, Not very elegant but you do at least get an audio controller and it works (on S4, Nexus 7 and Kindle Fire) so it must be a Corona issue rather than specific to the Android OS.