Search code examples
androidaudio-recordingandroid-audiorecord

AudioRecord: bits per sample


AudioRecord has methods to get the data as byte[], short[] and ByteBuffer.

I can't see anything in the documentation which says how many bits per sample are used.

Can it record in 8 bits? 16 bits? More? (How is this determined/set?)

Can the method which returns byte[]/ByteBuffer be used for 16 bit samples, and how would the most significant byte / least significant byte be differentated?


Solution

  • Presumably this is what getAudioFormat() tells you...