Whisper Language Detector Node
Identifies the spoken language of a segment of audio with a multilingual Whisper model. It runs only Whisper's encoder and a single decoder step, so a detection is faster than a transcription and needs no transcript. Pair it with a VAD node: connect the VAD's speechEnded event to the detect action and every utterance is identified.
| Number of inputs | 1 |
| Number of outputs | 0 |
Configuration​
modelPath​
Type: String
Default: ""
Path of a multilingual ggml model such as ggml-small.bin; @system/ and @user/ asset aliases are resolved. Empty loads the Whisper extension's multilingualModelPath. The bundled English-only models (.en) are refused: whisper.cpp would run detection on them and report a random language.
useGPU​
Type: Bool
Default: true
Run the model on the GPU where one is available.
minimumDurationMs​
Type: Int
Default: 500
Segments shorter than this are ignored. A fragment of a word yields a random, low-confidence language, which a VAD can produce when it splits an utterance.
Properties​
Inherits properties from its parent, SingleBusAudioSinkNode.
Actions​
Inherits actions from its parent, SingleBusAudioSinkNode.
detect​
Detects the language of a segment of the received audio and emits languageDetected. The node keeps the last 30 seconds of audio at 16 kHz.
Parameters​
| Name | Type | Description |
|---|---|---|
| start | Int | Start sample of the segment (16 kHz, absolute). Optional: omit together with end. |
| end | Int | End sample of the segment (16 kHz, absolute). Optional: omit together with start. |
Without parameters the segment is everything received since the previous detect call. The parameters match the speechEnded event of the Silero VAD node, so the two can be connected directly.
Return Value​
None. Returns an error when no model is loaded.
loadModel​
Loads a multilingual ggml Whisper model, replacing the current one. Emits modelLoaded or modelLoadFailed.
Parameters​
| Name | Type | Description |
|---|---|---|
| modelPath | String | Path of the model; @system/ and @user/ aliases are resolved. |
| useGPU | Bool | Whether to use GPU acceleration. Optional, default true. |
Return Value​
None. Returns an error when the model cannot be loaded or is English-only.
Events​
Inherits events from its parent, SingleBusAudioSinkNode.
languageDetected​
Emitted when the language of a segment has been identified.
Data​
| Name | Type | Description |
|---|---|---|
| language | String | ISO 639-1 code of the most likely language, e.g. "es". |
| languageName | String | English name of that language, e.g. "spanish". |
| confidence | Float | Probability of the reported language, 0 to 1. |
| processingTime | Int | Time taken for detection in milliseconds. |
modelLoaded​
Emitted when a model is loaded successfully.
| Name | Type | Description |
|---|---|---|
| modelPath | String | Path of the loaded model. |
modelLoadFailed​
Emitted when loading a model fails.
| Name | Type | Description |
|---|---|---|
| modelPath | String | Path of the model that failed. |
| error | String | Failure reason. |