Search code examples
androidandroid-ndkaudio-recordingpcm

how to get the pcm data of android?


i'm try to get pcm data by class AudioRecord, the source of audio from headset,it linked a device ,the device will send some wave to my app(i hope you can understand what i say).![difference device's wave],the picture at https://i.sstatic.net/5iZnY.png

we see the picture, wave 1 and wave 2,i can get the right result,because i can calculate the point of one cycle, but using sony xl36h, i received wave not closeness real wave, device actually send signal closeness to wave 1. my question is what caused this phenomenon, how to get the closeness wave such like wave1? i think it maybe Sony optimize the bottom layer of audio ,if that ,should i use NDK to avoid that?


Solution

  • should i use NDK to avoid that?

    No, you will get the same results with the NDK.

    AudioRecord provides already access to the raw PCM data. The difference between the devices occures because they use different audio modules. The modules have different hardware features (low pass filters/ sensibility) and you can not disable them through software. The reason behind that is that these features reduce noise.