Using AudioTrack in Android to play a WAV file

后端 未结 7 970
别跟我提以往
别跟我提以往 2020-12-01 05:50

I\'m working with Android, trying to make my AudioTrack application play a Windows .wav file (Tada.wav). Frankly, it shouldn\'t be this hard, but I\'m hearing a lot of stra

7条回答
  •  暖寄归人
    2020-12-01 06:01

    As said by Aaron C, you have to skip initial 44 bytes or (as I prefer) read first 44 bytes that are the WAVE header. In this way you know how many channels, bits per sample, length, etc... the WAVE contains.

    Here you can find a good implementation of a WAVE header parser/writer.

提交回复
热议问题