Decoding audio via Android using FFMpeg

后端 未结 2 1502
傲寒
傲寒 2021-02-01 11:36

I can play Wav files using the below code without issues. When trying to play the exact same media in Mp3 format I only get garbled junk. I believe I am fundamentally misunder

2条回答
  •  旧时难觅i
    2021-02-01 11:51

    Ah, you might need to check the data_size value after the call to avcodec_decode_audio3: right now you always feed the return value to the play method, but if data_size is less than 0 then it is not a valid frame decode.

提交回复
热议问题