TranscriptLine
Represents a single segment of speech (roughly equivalent to a phrase or sentence).Fields
UTF-8 encoded transcription text
Time offset in seconds from session start when speech began
Duration of the speech segment in seconds
Unique 64-bit identifier for this line (stable across updates)
True when the segment is finalized, False while still being spokenTrue if any field changed since the last transcript updateTrue if this line was just added in the latest updateTrue if the text field specifically changed (subset of is_updated)True if speaker identification has completed for this lineUnique 64-bit identifier for the speaker (stable across sessions for same voice)
Sequential speaker number (0, 1, 2…) in order of first appearance
Raw 16kHz mono PCM audio data for this segment as floats (-1.0 to 1.0).
None if return_audio_data option is disabled.Example
Transcript
Container for a list ofTranscriptLine objects, representing a complete transcription session.
Fields
List of transcript lines in chronological order
Methods
Example
IntentMatch
Represents a matched voice command.Fields
The registered command phrase that was matched
The actual user’s words that triggered the match
Confidence score between 0.0 and 1.0 indicating how well the utterance matches the intent
Example
ModelArch
Enum for ASR model architectures.Values
26M parameters, smallest model, fastest inference
58M parameters, balanced accuracy/speed
34M parameters, supports streaming with caching
123M parameters, high accuracy streaming
245M parameters, highest accuracy (better than Whisper Large V3)
Example
EmbeddingModelArch
Enum for embedding model architectures used in intent recognition.Values
Gemma-based 300M parameter sentence embedding model
Example
Helper Functions
load_wav_file
Load a WAV file into audio data and sample rate.Path to WAV file
(audio_data: List[float], sample_rate: int)
get_model_for_language
Download and get path to ASR model for a language.Language code: “en”, “es”, “ar”, “ja”, “ko”, “zh”, “uk”, “vi”
Specific model architecture (0-5). If None, uses highest quality available.
(model_path: str, model_arch: int)
get_embedding_model
Download and get path to embedding model for intent recognition.Embedding model name. Currently only “gemma-300m” is supported.
Model quantization: “fp32”, “fp16”, “q8”, “q4”, “q4f16”
(model_path: str, model_arch: int)
supported_languages
Get list of supported language codes.supported_languages_friendly
Get dictionary of language codes to full names.model_arch_to_string
Convert ModelArch enum to string name.string_to_model_arch
Convert string name to ModelArch enum.get_assets_path
Get path to bundled assets directory.get_model_path
Get standard model cache path.Error Classes
MoonshineError
Base exception class for all Moonshine errors.MoonshineUnknownError
Raised when an unknown error occurs.MoonshineInvalidHandleError
Raised when an invalid transcriber or recognizer handle is used.MoonshineInvalidArgumentError
Raised when invalid arguments are passed to a function.See Also
- Transcriber API - Using these structures
- Events API - Event types containing these structures
- Transcription Guide - Working with transcripts