Skip to content

Class FTryllVoiceInput

ClassList > FTryllVoiceInput

More...

  • #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

void FTryllVoiceInput::CancelUtterance (
    TFunction< void(const FTryllError &)> OnComplete=nullptr
) 

Cancel the current utterance without producing a transcript.


function ClearAfterDestroyRequest

void FTryllVoiceInput::ClearAfterDestroyRequest () 

Called by UTryllSubsystem when the DestroyVoiceInput Ack arrives; clears the local id.


function EndUtterance

void FTryllVoiceInput::EndUtterance (
    TFunction< void(const FTryllError &)> OnComplete=nullptr
) 

Commit the current utterance (push-to-talk release).


function FTryllVoiceInput

FTryllVoiceInput::FTryllVoiceInput (
    TSharedPtr< FTryllConnection > InConnection,
    std::uint64_t InVoiceInputId
) 

function GetVoiceInputId

inline std::uint64_t FTryllVoiceInput::GetVoiceInputId () noexcept const

function HandleAckResult

void FTryllVoiceInput::HandleAckResult (
    std::uint64_t RequestId,
    const FTryllError & Error
) 

function HandleError

void FTryllVoiceInput::HandleError (
    const FTryllError & Error
) 

function HandleTranscriptUpdate

void FTryllVoiceInput::HandleTranscriptUpdate (
    const FString & Text,
    ETryllTranscriptUpdateKind Kind,
    int32 AudioMsConsumed
) 

function IsUtteranceActive

inline bool FTryllVoiceInput::IsUtteranceActive () noexcept const

function IsValid

inline bool FTryllVoiceInput::IsValid () noexcept const

function SendAudioBuffer [1/2]

void FTryllVoiceInput::SendAudioBuffer (
    const int16 * Samples,
    int32 NumSamples
) 

Push a block of mono int16 PCM to the server. Fire-and-forget; dropped silently when no utterance is active.


function SendAudioBuffer [2/2]

inline void FTryllVoiceInput::SendAudioBuffer (
    const TArray< int16 > & Samples
) 

function SetOnError

void FTryllVoiceInput::SetOnError (
    TFunction< void(const FTryllError &)> Callback
) 

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

FTryllVoiceInput::~FTryllVoiceInput () 


The documentation for this class was generated from the following file C:/_tryll/_monorepo2/server/client-unreal/Source/TryllClient/Public/TryllVoiceInput.h