Class UTryllVoiceInputComponent¶
ClassList > UTryllVoiceInputComponent
#include <TryllVoiceInputComponent.h>
Inherits the following classes: UActorComponent
Public Attributes¶
| Type | Name |
|---|---|
| float | HotwordsScore = 1.5f |
| FTryllStoragePath | HotwordsStoragePath |
| int32 | MaxUtteranceMs = 60000 |
| FTryllModelName | ModelName = TEXT("Whisper Tiny EN (int8)") |
| FOnTryllVoiceError | OnError |
| FOnTryllTranscriptUpdate | OnTranscriptUpdate |
| FOnTryllVoiceInputCreated | OnVoiceInputCreated |
| UTryllAgentComponent * | TargetAgent = nullptr |
| int32 | VadMinSilenceMs = 500 |
| int32 | VadSpeechPadMs = 250 |
| float | VadThreshold = 0.5f |
| bool | bAutoFinishOnSilence = true |
| bool | bCreateOnConnect = true |
| bool | bWaitForAgentReady = true |
Public Functions¶
| Type | Name |
|---|---|
| void | BeginUtterance (UTryllAgentComponent * AgentOverride=nullptr) |
| void | CancelUtterance () |
| void | CreateVoiceInput () |
| void | DestroyVoiceInput () |
| void | EndUtterance () |
| TSharedPtr< FTryllVoiceInput > | GetVoiceInput () const |
| bool | HasVoiceInput () const |
| bool | IsUtteranceActive () const |
| UTryllVoiceInputComponent () |
Protected Functions¶
| Type | Name |
|---|---|
| virtual void | BeginPlay () override |
| virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
| virtual void | TickComponent (float DeltaTime, ELevelTick TickType, FActorComponentTickFunction * ThisTickFunction) override |
Detailed Description¶
Actor component: owns one FTryllVoiceInput (STT) handle and drives it from the system microphone. The Unreal counterpart to the Unity TryllVoiceInputComponent.
Capture model: on-demand. The microphone opens on BeginUtterance() and closes when the final transcript arrives (or on End / Cancel). The component ticks to drain captured PCM and forward it to the server.
Audio: the device-native sample rate is declared to the server, which resamples to the STT model's expected rate. Multi-channel input is downmixed to mono.
All delegates fire on the game thread.
Public Attributes Documentation¶
variable HotwordsScore¶
Logit-bias score applied to hotword tokens during decoding.
variable HotwordsStoragePath¶
Plain string storage containing hotword / wake-word phrases (one per line). Relative to TryllRuntimeSettings::StorageDataFolder, e.g. "hotwords.txt". Leave empty to disable hotword boosting.
variable MaxUtteranceMs¶
Hard timeout (ms) per utterance.
variable ModelName¶
STT model — picked from the project's registered models (Model Manager).
variable OnError¶
Fired on protocol-level errors.
variable OnTranscriptUpdate¶
Fired for each transcript update (partial and final).
variable OnVoiceInputCreated¶
Fired when the VoiceInput handle has been created.
variable TargetAgent¶
Agent that receives the final transcript. Leave unset to auto-use the UTryllAgentComponent on the same actor (the common case — the details panel can't pick sibling components, so this resolves in BeginPlay). Put the Voice component on an actor with no agent for transcribe-only mode.
variable VadMinSilenceMs¶
Silence duration (ms) that closes a speech segment.
variable VadSpeechPadMs¶
Padding (ms) added around detected speech.
variable VadThreshold¶
Silero VAD speech-probability threshold.
variable bAutoFinishOnSilence¶
Let server VAD close the utterance on silence (stop-on-silence mode).
variable bCreateOnConnect¶
Create the VoiceInput handle automatically once the session is ready (connected + configured); queues until OnCreateSessionComplete if it spawns earlier. (Name kept for compatibility; it fires on session-ready, not raw connect.)
variable bWaitForAgentReady¶
Sequence VoiceInput creation behind the sibling agent: wait for the agent's OnAgentReady before creating the VoiceInput, instead of creating as soon as the session is ready. This serialises first-run model auto-downloads so the STT/VAD fetch never overlaps the agent's LLM/TTS fetch — concurrent downloads deadlock the server's shared HuggingFace connection. Ignored when there is no TargetAgent (transcribe-only). Set false to restore the old concurrent behaviour.
Public Functions Documentation¶
function BeginUtterance¶
Open a new utterance and start microphone capture. The final transcript is routed to AgentOverride when given, otherwise to TargetAgent; transcribe-only when both are null.
function CancelUtterance¶
Cancel the current utterance without producing a transcript.
function CreateVoiceInput¶
Create the server-side VoiceInput handle. Ignored when one already exists.
function DestroyVoiceInput¶
Destroy the handle and release the server-side session.
function EndUtterance¶
Commit the current utterance (push-to-talk release).
function GetVoiceInput¶
Live handle. Null until CreateVoiceInput completes.
function HasVoiceInput¶
True once the server-side VoiceInput handle exists.
function IsUtteranceActive¶
True while an utterance is open.
function UTryllVoiceInputComponent¶
Protected Functions Documentation¶
function BeginPlay¶
function EndPlay¶
virtual void UTryllVoiceInputComponent::EndPlay (
const EEndPlayReason::Type EndPlayReason
) override
function TickComponent¶
virtual void UTryllVoiceInputComponent::TickComponent (
float DeltaTime,
ELevelTick TickType,
FActorComponentTickFunction * ThisTickFunction
) override
The documentation for this class was generated from the following file C:/_tryll/_monorepo3/tryll/clients/unreal/Source/TryllClient/Public/TryllVoiceInputComponent.h