mp.tasks.audio.AudioTranscriber

Performs streaming and unary speech-to-text transcription.

handle Opaque C pointer created by MpAudioTranscriberCreate.

Methods

close

View source

Closes the transcriber and releases native C++ resources.

create_from_model_path

View source

Creates an AudioTranscriber from a .litertlm model path.

create_from_options

View source

Creates an AudioTranscriber instance from AudioTranscriberOptions.

finish_stream

View source

Flushes any buffered audio and finalizes the current stream.

prewarm

View source

Runs a dummy warm-up pass to initialize execution kernels.

transcribe

View source

Transcribes mono PCM float32 audio samples in [-1.0, 1.0].

Args
audio_samples Sequence or 1D NumPy array of mono float32 PCM samples.
end_of_stream Whether this audio chunk concludes the current stream.

Returns
An AudioTranscriberResult containing recognized segments.

__enter__

View source

__exit__

View source