Skip to content

Class FTryllVisemePlayer

ClassList > FTryllVisemePlayer

More...

  • #include <TryllVisemePlayer.h>

Classes

Type Name
struct FSettings

Public Attributes

Type Name
FSettings Settings

Public Functions

Type Name
void AddEvents (TArrayView< const FTryllVisemeEvent > Events)
void ApplySettings (const FTryllVisemeSettings & In)
void BeginTurn (int32 SampleRate, int64 TurnOriginSamples)
FTryllVisemePlayer ()
ETryllViseme GetActiveViseme () const
const TArray< FName > & GetChannels () const
float GetCurve (FName Channel) const
TConstArrayView< float > GetCurves () const
float GetSmoothingLagMs () const
void Reset ()
void SetPoses (TConstArrayView< FTryllVisemePose > Poses)
void Tick (int64 PlayedSamples, float DeltaSeconds)

Public Static Functions

Type Name
TArray< FTryllVisemePose > DefaultPoses ()

Detailed Description

Plays a TTS viseme track as ARKit curve values, in step with audio playback.

Engine-object free so any consumer can drive it: UTryllLipSyncComponent writes the curves to morph targets, and a MetaHuman integration can push the same curves through Epic's ARKit mapping.

Per turn: BeginTurn (from UTryllSpeakerComponent::OnTtsTurnStarted), then AddEvents for each viseme frame (OnTtsVisemes). Every frame: Tick with the playback clock's played samples, then read GetCurves().

What it does, as in the Unity client's TryllLipSync: * the active viseme's pose, scaled by the event weight (loudness); * a smoothstep cross-fade over AttackDecayMs into each new viseme; * Intensity scales everything; * exponential smoothing at SmoothingPerSecond, ClosureSmoothingPerSecond while p/b/m or f/v is showing (a ~70 ms closure never lands at the slow rate); * the track is read ahead by the delay that smoothing adds, so tuning it does not move sync; * rest once the last shape of a turn has been held MaxHoldMs.

Public Attributes Documentation

variable Settings

FSettings FTryllVisemePlayer::Settings;

Public Functions Documentation

function AddEvents

void FTryllVisemePlayer::AddEvents (
    TArrayView< const FTryllVisemeEvent > Events
) 

function ApplySettings

void FTryllVisemePlayer::ApplySettings (
    const FTryllVisemeSettings & In
) 

Copies the editable settings (a component's Details panel) into Settings.


function BeginTurn

void FTryllVisemePlayer::BeginTurn (
    int32 SampleRate,
    int64 TurnOriginSamples
) 

function FTryllVisemePlayer

FTryllVisemePlayer::FTryllVisemePlayer () 

function GetActiveViseme

inline ETryllViseme FTryllVisemePlayer::GetActiveViseme () const

function GetChannels

inline const TArray< FName > & FTryllVisemePlayer::GetChannels () const

Every channel any pose drives; a consumer binds exactly these.


function GetCurve

float FTryllVisemePlayer::GetCurve (
    FName Channel
) const

Current value of one channel (0 if it isn't driven).


function GetCurves

inline TConstArrayView< float > FTryllVisemePlayer::GetCurves () const

Smoothed value per channel after the last Tick, 0..1, aligned with GetChannels().


function GetSmoothingLagMs

float FTryllVisemePlayer::GetSmoothingLagMs () const

Look-ahead applied for the smoothing delay, in milliseconds.


function Reset

void FTryllVisemePlayer::Reset () 

Drops the track and eases back to rest.


function SetPoses

void FTryllVisemePlayer::SetPoses (
    TConstArrayView< FTryllVisemePose > Poses
) 

Replaces the pose table. Empty uses DefaultPoses().


function Tick

void FTryllVisemePlayer::Tick (
    int64 PlayedSamples,
    float DeltaSeconds
) 

Advances to the audible position. PlayedSamples is FTryllTtsPlaybackClock::GetPlayedSamples().


Public Static Functions Documentation

function DefaultPoses

static TArray< FTryllVisemePose > FTryllVisemePlayer::DefaultPoses () 

Hand-authored from published Oculus / VRChat viseme references (same table as the Unity client).



The documentation for this class was generated from the following file C:/_tryll/_monorepo3/tryll/clients/unreal/Source/TryllClient/Public/TryllVisemePlayer.h