Raw Audio Recording with AudioRecord
Aside from using an intent to launch the sound recorder and using the
MediaRecorder, Android offers a third method to capture audio, using a class called
AudioRecord is the most flexible of the three methods in that it allows us access to the raw audio stream but has the least number of built-in capabilities, such as not automatically compressing the audio.
The basics for using
AudioRecord are straightforward. We simply need to construct an object of type
AudioRecord, passing in various configuration parameters.
The first value we'll need to specify is the audio source. The values for use here are the same as we used for the
MediaRecorder and are defined in
MediaRecorder.AudioSource. Essentially ...