and then i execute the playerWhat exactly are the contents of your "audioFile"? Does it contain a WAV file header? Because if it does, you're not handling that in your code and the audio system is going to try to play your fileheader. If the fileheader happens to not line up to a multiple of 16 bits, then your entire audio stream will be messed up because it'll be offset by 8 bits...
but the result is noise
cecol wrote:Save the file as a WAV file and try to play it with some audio program. If another audio program can play it, it means it had a WAV header.
how to know WAV file header?
cecol wrote:You need to use your decoder to decode the AMR file into the linear PCM bytes, and then write the PCM audio to the SDL... Sorry, I skipped a step in my previous explanation.
The amr file is a hybrid speech coder which uses Algebraic Code Excited Linear Prediction (ACELP)
i think that it can not play with SDL , because SDL only accept PCM format
cecol wrote:It can be used, you've just got one of the parameters incorrect... if you don't have absolutely every single parameter correct, you'll get noise from perfectly good sound data...
thank you for your reply ,captfoss
i had tired the way you skipped,but it only noise
it appears this way can not be used
i believe that JavaSound have ability can play PCM dataWAV files are PCM data, so yes, JavaSound definately has the ability to play PCM data.