I’m developing an Android app that receives a byte array that is a GSM 6.10 compressed .wav file. Here are the the things I’ve tried:
Playing it with AudioTrack did not work because AudioTrack does not support GSM 6.10 compressed wavs.
Saving the byte[] and using MediaPlayer to play it did not work. It just produced static.
The last idea I tried does not work for this app but was just a shot in the dark to narrow down where the problem is. Before running the app I saved the wav to the sd card. Then I tried playing this already saved file using MediaPlayer. It worked. I then tried reading this same saved file in the app then saving back to the sd card again with a different name(ex. tempFile.wav). When I tried to play the new saved file, all I got was static. This leads me to believe that the problem might be in saving the byte[] as a .wav.
So, I either need to be able to convert the GSM 6.10 compressed wav to PCM or correctly save it as wav on the device. I’m new to Android development so any help would be greatly appreciated!
It looks like the solution to this is Android’s SoundPool. By saving the byte[] wav to the sd card and using SoundPool to play it, everything worked fine.