Capture Config
What to capture and where it goes.
The defaults suit speech: 16 kHz mono PCM16 in 100 ms chunks, the format most speech-to-text APIs expect. Set file to also record, or set pcm to null to only record.
Constructors
Properties
1 (mono) or 2 (stereo). Whether stereo is two real microphones or one duplicated depends on the device, the input and (on Android) the audio source; AndroidAudioSource.Camcorder is the most likely to give real stereo.
How much audio each AudioChunk holds and how often CaptureSession.level updates.
Preferred microphone, from AudioCapture.inputDevices. null is the system default.
A file written while capturing, or null for none.
Raw PCM delivered through CaptureSession.chunks, or null for none.
Samples per second, per channel. 16 000, 44 100 and 48 000 work on all current phones; Android only guarantees 44 100, and AudioCapture.start throws if the device refuses a rate. AAC files are limited to 8 000–48 000.
Echo cancellation, noise suppression and gain control, or null for the unprocessed signal. Experimental: see ExperimentalVoiceProcessing.