Skip to main content
Two shapes. Pick by where your audio comes from.

Push: openStream

You hold a handle and push frames as AudioRecord produces them.

Pull: transcribeStream

You already have a Flow<AudioInput>.

Signatures

Driving it from AudioRecord

Always release the recorder and close the stream in a finally. A leaked AudioRecord holds the microphone for the whole process.

Choosing between them

Push suits a live microphone, since AudioRecord already hands you buffers in a loop. Pull suits a source you can express as a Flow, such as a file read in chunks or audio arriving over the network.