Can I get raw PCM data from MediaPlayer or SoundPool?

前端 未结 3 882
星月不相逢
星月不相逢 2021-01-13 14:20

i use eclipse with android sdk 4.0.3 api lvl 15 to create a basic music player application.

I read and found that there are two main classes to play sounds. MediaPla

3条回答
  •  伪装坚强ぢ
    2021-01-13 14:48

    I have strong feeling you're out of luck to get PCM from these Android classes. They're certainly too much tied to native layer (due to performance), and implementation differs on various api versions or devices. If you didn't find any PCM-related API yet, then there may not be any.

    Solution would be to make audio mixer yourself, either in Java or C/C++, then you'd have PCM data. I expect it to be rather slow to get PCM data to Java, process it there, send back to audio playback. You'd probably have to go down to NDK programming.

提交回复
热议问题