PCM Raw Bytes [] To Audio on Android

后端 未结 2 1630
[愿得一人]
[愿得一人] 2020-12-24 13:50

I currently have a PCM audio in the form of a byte array. The format is signed 16 bit little endian. I would like to convert this to some playable format on the Android, pre

2条回答
  •  梦毁少年i
    2020-12-24 14:28

    http://developer.android.com/reference/android/media/AudioTrack.html

    This class looks like it has exactly what you need!

    write(byte[] audioData, int offsetInBytes, int sizeInBytes)
    

    Writes the audio data to the audio hardware for playback.

    EDIT

    Change your stream to AudioManager.STREAM_MUSIC

提交回复
热议问题