Class FTryllVoiceInput¶
#include <TryllVoiceInput.h>
Inherits the following classes: TSharedFromThis< FTryllVoiceInput >
Public Functions¶
| Type | Name |
|---|---|
| void | BeginUtterance (const FTryllUtteranceOptions & Opts, TFunction< void(const FTryllError &)> OnComplete=nullptr) |
| void | CancelUtterance (TFunction< void(const FTryllError &)> OnComplete=nullptr) |
| void | ClearAfterDestroyRequest () |
| void | EndUtterance (TFunction< void(const FTryllError &)> OnComplete=nullptr) |
| FTryllVoiceInput (TSharedPtr< FTryllConnection > InConnection, std::uint64_t InVoiceInputId) |
|
| std::uint64_t | GetVoiceInputId () noexcept const |
| void | HandleAckResult (std::uint64_t RequestId, const FTryllError & Error) |
| void | HandleError (const FTryllError & Error) |
| void | HandleTranscriptUpdate (const FString & Text, ETryllTranscriptUpdateKind Kind, int32 AudioMsConsumed) |
| bool | IsUtteranceActive () noexcept const |
| bool | IsValid () noexcept const |
| void | SendAudioBuffer (const int16 * Samples, int32 NumSamples) |
| void | SendAudioBuffer (const TArray< int16 > & Samples) |
| void | SetOnError (TFunction< void(const FTryllError &)> Callback) |
| void | SetOnTranscriptUpdate (TFunction< void(const FTryllTranscriptUpdate &)> Callback) |
| ~FTryllVoiceInput () |
Detailed Description¶
Plain C++ handle for a server-side VoiceInput (STT) session. Created by UTryllSubsystem after a successful CreateVoiceInputResponse. The Unreal counterpart to the C++ Tryll::VoiceInput and the Unity TryllVoiceInput.
Ownership: typically held as TSharedPtr<FTryllVoiceInput> by UTryllVoiceInputComponent. Lifetime: deterministic — the owning component releases the shared_ptr; this triggers UTryllSubsystem::RequestDestroyVoiceInput().
All callbacks are invoked on the game thread (from UTryllSubsystem::Tick).
Public Functions Documentation¶
function BeginUtterance¶
void FTryllVoiceInput::BeginUtterance (
const FTryllUtteranceOptions & Opts,
TFunction< void(const FTryllError &)> OnComplete=nullptr
)
Open a new utterance. Rejects locally (via OnComplete) with UtteranceInProgress when one is already active, or VoiceInputNotFound when the handle is invalid.
function CancelUtterance¶
Cancel the current utterance without producing a transcript.
function ClearAfterDestroyRequest¶
Called by UTryllSubsystem when the DestroyVoiceInput Ack arrives; clears the local id.
function EndUtterance¶
Commit the current utterance (push-to-talk release).
function FTryllVoiceInput¶
FTryllVoiceInput::FTryllVoiceInput (
TSharedPtr< FTryllConnection > InConnection,
std::uint64_t InVoiceInputId
)
function GetVoiceInputId¶
function HandleAckResult¶
function HandleError¶
function HandleTranscriptUpdate¶
void FTryllVoiceInput::HandleTranscriptUpdate (
const FString & Text,
ETryllTranscriptUpdateKind Kind,
int32 AudioMsConsumed
)
function IsUtteranceActive¶
function IsValid¶
function SendAudioBuffer [1/2]¶
Push a block of mono int16 PCM to the server. Fire-and-forget; dropped silently when no utterance is active.
function SendAudioBuffer [2/2]¶
function SetOnError¶
Fired on protocol-level errors not tied to a Begin/End/Cancel callback.
function SetOnTranscriptUpdate¶
void FTryllVoiceInput::SetOnTranscriptUpdate (
TFunction< void(const FTryllTranscriptUpdate &)> Callback
)
Fired for each transcript update (partial and final). Invoked on the game thread.
function ~FTryllVoiceInput¶
The documentation for this class was generated from the following file C:/_tryll/_monorepo2/server/client-unreal/Source/TryllClient/Public/TryllVoiceInput.h