Speech To Text

Speech To Text operator properties for Script Engine. Listens to the layer's audio and transcribes it to text in real time, optionally drawing the result on screen as live captions. Useful for live captioning, accessibility overlays, post-show transcripts, automated content moderation, foreign-language productions where subtitles need to appear instantly, and any workflow where what's being said needs to be captured as text. Includes optional find-and-replace rules for fixing recurring misrecognitions or filtering profanity. Accuracy depends on the loaded model and the quality of the incoming audio (clear voice, low background noise gives the best results).

Property Type Access Description
ShowAdvancedOptions bool get/set Whether to reveal advanced configuration in the editor. [default=false]. Toggle on to show options like the script callback fields.
ModelSourceUrl Uri get/set Path to the speech recognition model file (.bin) used for transcription. A larger model costs more video memory and more processing time per second of audio. It earns that on clean speech a smaller one keeps mishearing, and on languages other than the most widely spoken; it does not make up for a noisy location, cross-talk or a strong accent. Loading a new model reinitialises the operator.
SourceLanguage WhisperLanguage get/set Language spoken in the audio. [default=English]. Auto-detect lets the model pick the language from the audio itself, at a slightly higher processing cost per pass. Only multilingual models can change language; English-only models (file name containing ".en") keep this locked to English.
DetectedLanguage string get Language the model used for the most recent text (read-only). With Auto-detect this is the detected language; otherwise it mirrors Source Language. Shown as name and code, e.g. "Swedish (sv)".
AllowedLanguages string get/set Languages auto-detect is allowed to transcribe, comma-separated. Codes or English names, in any case: "en, sv" and "English, Swedish" both work. Empty means no restriction, which is the default. Text the model heard as any other language is not shown, which keeps out the invented text a model produces when it wanders into a language nobody is speaking. Only applies with Source Language on Auto-detect, and is locked otherwise.
AutoStart bool get/set Whether to start listening automatically once the model finishes loading. [default=true]. Saves a manual click when the project is loaded fresh; turn off if you want to start transcription only on demand.
OperatorState OperatorState get Current state of the operator (read-only). Reports whether no model is selected, the model is loaded, the operator is running or stopped, or an error occurred.
StartCommand Command get Begin transcribing the layer's audio. Available once a valid model is loaded.
StopCommand Command get Stop transcribing audio.
ClearCommand Command get Clear the on-screen captions and reset the audio context so previous speech doesn't bleed back in.
ConfidenceLevel int get/set Minimum confidence (in percent) a recognised word must score to appear on screen. [min=10, max=100, default=70]. Raise to suppress weak guesses — fewer words appear, but the ones that do are more likely correct. Lower to surface more text, at the cost of occasional misheard words.
AudioBuffer int get/set How much audio is collected before each transcription pass, in milliseconds. [min=100, max=2000, default=1000]. Every pass re-transcribes the whole utterance so far, so halving this roughly doubles the GPU and CPU work. Lower values give snappier captions with less context for the model to reason from; higher values are more accurate and lighter, but the captions appear later. The larger models need a higher value to keep up with live audio.
PauseThreshold int get/set How long the speaker must be silent before the words so far are locked in, in milliseconds. [min=100, max=5000, default=250]. Shorter values settle the text sooner; longer values let the model keep improving a stretch of speech before it is fixed. Two speakers handing over need a short value, since the gap between their turns is often under half a second and a longer setting never fires in it.
NoSpeechThreshold int get/set Whisper's own silence check, as a percentage: how sure the model must be that a whole stretch of audio held no speech before the text it produced for it is discarded. [min=0, max=100, default=60]. The verdict covers the whole utterance, not single words, so a stretch the model hears speech in is never touched, whatever noise rides along with the words. It catches the silence that still reaches the model: a false start on a breath or a music bed before anyone talks. Lower values discard more readily; 100 turns the check off, and low-confidence results are then retried at higher temperatures instead, which costs GPU time. Phantom words inside speech are Confidence's job, not this one's.
CorrectableWords int get/set How many words at the end of the live text the model may still correct. [min=0, max=10, default=0]. Words before them are locked as soon as they appear, so only a short tail ever moves on screen. 0 keeps the default rule, where a word is locked once two recognition passes agree on it. Applies to languages written with spaces between words.
DecodeOnlyAtPause bool get/set Whether speech is recognised only when Pause Detection fires, once per utterance, instead of live every Audio Buffer. [default=false]. With it on there is no live text: the words of an utterance appear together shortly after the speaker pauses, are finalised at once and never change. Far fewer recognition passes, which is what it is for.
ResetThresholdValuesCommand Command get Reset all threshold values to their defaults (confidence, audio buffer, pause detection, no-speech, correctable words, decode only at pauses).
ShowSubtitlesCheckBox bool get/set Whether to draw captions on the output image. [default=true]. Turn off if you only want to use the recognised text from a script (via RecentText and the callback) without on-screen captions.
SubtitlesScreenTimout int get/set How long captions stay on screen after the speaker stops talking, in milliseconds. [min=100, max=10000, default=2500]. Longer values give the audience more reading time. Shorter values keep the screen uncluttered between sentences.
TextAlignment CaptionAlignment get/set Which edge the caption block is anchored to and the direction its rows are read in. [default=Left]. Left for most languages. Right for right-to-left languages such as Arabic and Hebrew: each row ends at Pos-X from the right edge and reads towards the left, while a number or a left-to-right phrase inside it still reads forwards. Takes effect from the next caption drawn.
SubtitlesPosX int get/set Horizontal position of the caption block, in pixels from the edge Text Alignment anchors it to: the left edge with Left, the right edge with Right. The same value keeps the same margin either way. [min=0, max=4096, default=100].
SubtitlesPosY int get/set Vertical position of the live caption line, in pixels from the top edge; the finished lines stack upward from it, so leave room for them above. [min=0, max=4096, default=250].
MaxLineLimit int get/set Maximum number of caption lines on screen at once. [min=1, max=10, default=3]. When the limit is reached the oldest line scrolls away. Lower values keep the screen uncluttered; higher values give more reading time across longer monologues.
MaxCharPerLineLimit int get/set Maximum characters per caption line before wrapping. [min=1, max=200, default=60].
SmallLettersOnly bool get/set Whether all captions are forced to lower-case. [default=false]. "I" and a few common contractions are still kept capitalised for readability.
ResetTextDisplayCommand Command get Reset the caption display to its defaults: text shown, the text-on-screen timeout, left alignment, the caption position, max lines, max chars per line and lower-case mode off.
FontFamily StringCollectionEnum get/set Which font draws the captions. [default=Arial or Segoe UI where installed, otherwise the first available font]. Pick a font that has the characters of the spoken language, for example a Japanese font for Japanese captions. A font missing on this machine is kept as the project's choice, with a note beside this row; the captions use the default until the project runs somewhere that has it.
FontSize int get/set Caption font size, in pixels. [min=11, max=60, default=38].
FontColorR int get/set Red component of the caption text colour. [min=0, max=255, default=255].
FontColorG int get/set Green component of the caption text colour. [min=0, max=255, default=255].
FontColorB int get/set Blue component of the caption text colour. [min=0, max=255, default=255].
FontAlpha int get/set Caption text opacity. [min=0, max=255, default=255]. 0 is fully transparent, 255 is fully solid.
SubtitleBackgroundAlpha int get/set Caption background opacity. [min=0, max=255, default=90]. 0 hides the background, 255 makes it fully solid. A subtle dark background helps readability over busy footage.
ResetTextAppearanceCommand Command get Reset all text appearance settings (font family, size, colour, alpha, background) to their defaults.
RecentText string get Most recently transcribed text (read-only). Updates every time the speech recognition engine produces a new result, and holds the caption as drawn, one line per row. Read this from a script to forward the live transcript to chat overlays, captions widgets, or any external system.
IsSubtitleActive bool get True while a caption is currently being shown (read-only). Resets when the text-on-screen timeout expires or the operator is cleared. Useful for scripts that need to react when speech starts or ends.
SubtitleStartTime string get UTC timestamp of the caption text currently showing (read-only). Advances with every update while the speaker talks, since the text is revised as recognition improves — it is the time of the text on screen now, not of the first words of the block. Useful for tagging subtitles with absolute time when feeding them to external systems.
SubtitleEndTime string get UTC timestamp when the captions left the screen (read-only). Empty while captions are showing; set when they are removed by the text-on-screen timeout, Stop or Clear.
SubtitleStartPts long get Video stream timestamp of the caption text currently showing (read-only). Advances with every update while the speaker talks, so it marks the frame the text on screen now was published on rather than the first words of the block. The input's raw timestamp in whatever units it provides, and zero if it provides none.
SubtitleEndPts long get Video stream timestamp of the frame the captions left the screen on (read-only). Zero while captions are showing, or if the input does not provide a presentation timestamp.
EnableTextReplacement bool get/set Whether to apply find-and-replace rules to the recognised text. [default=false]. Useful for fixing recurring misheard words ("Hugh" → "you"), expanding domain abbreviations, or filtering profanity. Pair with a rules file via TextReplacementFileUrl.
TextReplacementFileUrl Uri get/set Path to a JSON file containing find-and-replace rules. Each rule is a key/value pair where the key is the pattern to find and the value is the replacement. Supports exact matches and wildcard patterns (* for any characters, ? for one character). Reload Media re-reads the file if it changes on disk.
RulesLoadedCount int get Number of rules successfully loaded from the rules file (read-only).
ReplacementsAppliedCount int get Total number of replacements applied since the rules file was loaded (read-only).
EnableReplacementStats bool get/set Whether to log replacement statistics to a file in the Reports folder. [default=false]. Records which rules fired and how often, written to a file next to the executable and rewritten every ten seconds while the operator runs, so it can be read during a show. The project must be saved first, since the file is named after it. Useful for tuning the rules file by seeing what's actually being matched.
ReplacementStatsFileName string get Path of the current replacement-stats file (read-only).
ReplacementStatsStatus string get Status of the replacement-stats logger (read-only).
EnableTranscription bool get/set Whether to write all recognised speech to a transcript file in the Reports folder. [default=false]. Each speech segment is written as a timestamped line. Useful for archiving live shows and for accessibility post-production. The project must be saved first, since the transcript filename is based on the project name.
TranscriptFileName string get Path of the current transcript file (read-only).
ScriptCallbackFunction string get/set Name of a Script Engine function to call each time the transcription updates. Receives a JSON payload of text, startPts and endPts: the frame the text was published on, and the frame the captions left the screen, which is 0 while they are still showing. Both are the input's raw presentation timestamps, and 0 if it provides none. The update that reports the captions gone sends empty text, so draw whatever text arrives and clear when it is empty. Leave the field empty to disable.

Inherits from: AbstractOperator, AbstractAudioMetering, NamedModel.

See also: Speech To Text in Operators — user-facing introduction, screenshots, and section summaries.