Installation
Install the Stream Moonshine plugin withExample
Check out our Moonshine example to see a practical implementation of the plugin and get inspiration for your own projects, or read on for some key details.Initialisation
The Moonshine plugin for Stream exists in the form of theSTT
class:
We recommend using the Moonshine plugin combined with a VAD plugin like Silero to avoid excessive local processing.
Parameters
These are the parameters available in the MoonshineSTT plugin for you to customise:Name | Type | Default | Description |
---|---|---|---|
model_name | str | "moonshine/base" | The Moonshine model to use. Supported options are "moonshine/tiny" and "moonshine/base" . |
sample_rate | int | 16000 | The sample rate (in Hz) of the audio input. Must match Moonshine’s expected rate. |
language | str | "en-US" | Language code for transcription. Currently, only "en-US" is supported. |
min_audio_length_ms | int | 100 | Minimum length (in milliseconds) of audio required before processing. |
target_dbfs | float | -26.0 | Target RMS loudness level (in dBFS) for audio normalization before transcription. |
Functionality
Process Audio
Once you join the call, you can listen to the connection for audio events. You can then pass along the audio events for the STT class to process:Events
Transcript Event
The transcript event is triggered when a final transcript is available from Moonshine:Error Event
If an error occurs, an error event is fired:Close
You can close the STT connection with theclose()
method: