Ran into the following interesting problem with the Audio Hello World example: It worked in the emulator, but failed with an IOException (setDataSourceFD failed) on my Nexus S (2.3.4). After much headscratching, and discovering that the exception occurred for a.mp3, but not for example for f.mp3, I inspected the sample files with the Linux file command and discovered the following:
a, d, down and enter reported as: RIFF (little-endian) data, WAVE audio, MPEG Layer 3, mono 22050 Hz
while the rest of the files reported as: MPEG ADTS, layer III, v2, 32 kbps, 22.05 kHz, Monaural
Using Audacity to re-encode the first four to match the remaining ones solved the problems. My assumption is that my phone doesn’t include a WAVE codec, although it would have been nice if the error message had been more informative.
At any rate, I offer this detail in the hopes that anybody else stumbling over this will figure out how to move forward.