Speech Models
5 nodes
On this page 5
Load Speech Recognizer
FunctionLoads a speech recognizer, its feature extractor and its tokenizer from a Hub repository or a folder.
Signature
LoadSpeechRecognizer -> Speech Recognizer
model: Text
device: Compute Device
precision: Precision
backend: Model BackendSpeechRecognizer LoadSpeechRecognizer(
string model,
ComputeDevice device = ComputeDevice.Auto,
Precision precision = Precision.Auto,
ModelBackend backend = ModelBackend.TorchSharp)Parameters
| name | type | default | description |
|---|---|---|---|
| model | Text | — | A repository id such as openai/whisper-tiny or facebook/wav2vec2-base-960h, or for the ONNX backend onnx-community/whisper-tiny (onnx-community/whisper-tiny_timestamped for word times) or Xenova/wav2vec2-base-960h; or a folder. |
| device | Compute Device | Auto | Where it runs on TorchSharp. |
| precision | Precision | Auto | The number format of its weights on TorchSharp. |
| backend | Model Backend | Torch sharp | What runs it: TorchSharp, or the ONNX backend on the CPU, which reads the repository's ONNX files or builds a graph from its checkpoint. |
Returns
| Recognizer | Speech Recognizer |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Speech Models
- Package
- Machine Learning
Transcribe
FunctionWhat is said in a clip, as text.
Signature
Transcribe -> Text
recognizer: Speech Recognizer
audio: WAVAudioPayload
language: Text
settings: Transcription Settingsstring Transcribe(
SpeechRecognizer recognizer,
WAVAudioPayload audio,
string language,
TranscriptionSettings settings)Parameters
| name | type | default | description |
|---|---|---|---|
| recognizer | Speech Recognizer | — | A speech recognizer. |
| audio | WAVAudioPayload | — | The clip, at the recognizer's sample rate (16000 Hz for Whisper); Resample converts one that is not. Stereo is mixed to mono. |
| language | Text | — | For Whisper, the language spoken, such as en or english; empty to let it tell. |
| settings | Transcription Settings | — | For Whisper, a prompt and temperature fallback, from Make Transcription Settings. |
Returns
| Text | Text |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Speech Models
- Package
- Machine Learning
Transcribe File
FunctionWhat is said in a WAV file, as text.
Signature
TranscribeFile -> Text
recognizer: Speech Recognizer
path: Text
language: Text
settings: Transcription Settingsstring TranscribeFile(
SpeechRecognizer recognizer,
string path,
string language,
TranscriptionSettings settings)Parameters
| name | type | default | description |
|---|---|---|---|
| recognizer | Speech Recognizer | — | A speech recognizer. |
| path | Text | — | A WAV file at the recognizer's sample rate. |
| language | Text | — | For Whisper, the language spoken; empty to let it tell. |
| settings | Transcription Settings | — | For Whisper, a prompt and temperature fallback, from Make Transcription Settings. |
Returns
| Text | Text |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Speech Models
- Package
- Machine Learning
Transcribe With Times
FunctionWhat is said in a clip, in the segments the recognizer heard, with when each starts and ends.
Signature
TranscribeWithTimes -> (Segments: Text Array, starts: Number Array, ends: Number Array)
recognizer: Speech Recognizer
audio: WAVAudioPayload
language: Text
settings: Transcription Settingsstring[] TranscribeWithTimes(
SpeechRecognizer recognizer,
WAVAudioPayload audio,
string language,
out double[] starts,
out double[] ends,
TranscriptionSettings settings)Parameters
| name | type | default | description |
|---|---|---|---|
| recognizer | Speech Recognizer | — | A speech recognizer. |
| audio | WAVAudioPayload | — | The clip, at the recognizer's sample rate. |
| language | Text | — | For Whisper, the language spoken; empty to let it tell. |
| settings | Transcription Settings | — | For Whisper, a prompt and temperature fallback, from Make Transcription Settings. |
Returns
| Segments | Text Array |
| starts | Number Array |
| ends | Number Array |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Speech Models
- Package
- Machine Learning
Transcribe Words
FunctionWhat is said in a clip, word by word, with when each word starts and ends: for subtitles that follow the voice, or to find where a word was said.
Signature
TranscribeWords -> (Words: Text Array, starts: Number Array, ends: Number Array)
recognizer: Speech Recognizer
audio: WAVAudioPayload
language: Text
settings: Transcription Settingsstring[] TranscribeWords(
SpeechRecognizer recognizer,
WAVAudioPayload audio,
string language,
TranscriptionSettings settings,
out double[] starts,
out double[] ends)Parameters
| name | type | default | description |
|---|---|---|---|
| recognizer | Speech Recognizer | — | A speech recognizer. Whisper on the ONNX backend needs files with cross-attention outputs, such as onnx-community/whisper-tiny_timestamped. |
| audio | WAVAudioPayload | — | The clip, at the recognizer's sample rate. |
| language | Text | — | For Whisper, the language spoken; empty to let it tell. |
| settings | Transcription Settings | — | For Whisper, a prompt and temperature fallback, from Make Transcription Settings. |
Returns
| Words | Text Array |
| starts | Number Array |
| ends | Number Array |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Speech Models
- Package
- Machine Learning