BaseAudioRecordingSession
An abstract base class for AudioRecordingSession that handles the logic for providing a live "hot" flow during recording, and a replayable "cold" flow after the recording is finished.
This implementation solves the problem of the playback session never finishing by swapping the underlying flow implementation from a hot SharedFlow during recording to a cold, completable flow (backed by a List) once the recording is stopped.
Inheritors
Properties
Functions
Link copied to clipboard
Suspends until audio captured before stop has been delivered into audioFlow. Some platforms hand over their last buffer shortly after stop returns (e.g. a Web Audio worklet); Recorder.getRecording waits on this so recordings are not cut short. No-op by default.