get pcm data from mp3 file in android

后端 未结 1 659
悲哀的现实
悲哀的现实 2021-01-01 08:02

My question is simple. How do I get PCM data from the mp3 file?

Now I found only ne way to get PCM bytes from the song, I loaded and played mp3 by MediaPlayer<

相关标签:
1条回答
  • 2021-01-01 08:32

    I am using the mpg123 native library for decoding my MP3. It decoded into PCM data in shorts not bytes. I am sure you can do the conversions. The decoder is very fast since it uses the NDK.

    http://www.badlogicgames.com/wordpress/?p=446

    Also,

    I am not sure how big your files are but I would stream the bytes into the AudioTrack instead of putting the whole song in one big array.

    0 讨论(0)
提交回复
热议问题