UInworldBlueprintFunctionLibrary | Inherits from: UBlueprintFunctionLibrary
Methods
- BreakAudio
- BuildPhoneSpansFromTTSOutput
- CreateBooleanJinjaArgument
- CreateFloatJinjaArgument
- CreateIntJinjaArgument
- CreateInworldDataError
- CreateStringJinjaArgument
- CreateStructJinjaArgument
- DataStreamTTSOutputGetNext
- DataStreamTTSOutputHasNext
- GetCurrentWord
- GetPhonemeBlends
- GetPhonemeBlendsTTS
- GetRuntimeStruct
- GetVisemeBlends
- GetVisemeBlendsTTS
- MakeAudio
- RenderJinjaWithArgMap
- RenderJinjaWithJson
- TrimLLMOutput
- UnwrapInworldDataHandle
- WrapInworldData
Reference
BreakAudio
Parameters
| Parameter | Type | Description |
|---|---|---|
| Audio | const FInworldData_Audio& | The audio data to break apart |
| OutWaveform | TArray<uint8>& | The raw PCM waveform bytes |
| OutSampleRate | int32& | The sample rate of the audio |
BuildPhoneSpansFromTTSOutput
Builds a flat array of phone spans from a TTS output object. Extracts phonetic timing data fromTimestamps → PhoneticDetails.Phones. Use this to cache lip-sync data from a completed TTS output before playback.
Parameters
| Parameter | Type | Description |
|---|---|---|
| TTSOutput | const FInworldData_TTSOutput& | The TTS output containing phonetic timestamp data |
| OutPhoneSpans | TArray<FInworldPhoneSpan>& | The resulting flat array of phone spans |
CreateBooleanJinjaArgument
Parameters
| Parameter | Type | Description |
|---|---|---|
| Value | bool | The boolean value to wrap |
Returns
Type:FJinjaArgument
CreateFloatJinjaArgument
Parameters
| Parameter | Type | Description |
|---|---|---|
| Value | float | The float value to wrap |
Returns
Type:FJinjaArgument
CreateIntJinjaArgument
Parameters
| Parameter | Type | Description |
|---|---|---|
| Value | int32 | The integer value to wrap |
Returns
Type:FJinjaArgument
CreateInworldDataError
Parameters
| Parameter | Type | Description |
|---|---|---|
| InworldDataStructType | UScriptStruct* | The struct type to wrap the error in |
| StatusCode | EInworldStatusCode | The status code indicating the error type |
| Reason | const FString& | Human-readable description of the error |
| Data | int32& | Output: the resulting error data handle |
CreateStringJinjaArgument
Parameters
| Parameter | Type | Description |
|---|---|---|
| Value | FString | The string value to wrap |
Returns
Type:FJinjaArgument
CreateStructJinjaArgument
Parameters
| Parameter | Type | Description |
|---|---|---|
| Data | const int32& | The struct value to wrap (wildcard — accepts any USTRUCT) |
Returns
Type:FJinjaArgument
DataStreamTTSOutputGetNext
Retrieves the next TTS output chunk from a streaming TTS data stream. Should only be called whenDataStreamTTSOutputHasNext returns true.
Parameters
| Parameter | Type | Description |
|---|---|---|
| TTSOutputStream | FInworldData_DataStream_TTSOutput | The TTS data stream to read from |
Returns
Type:FInworldDataHandle
DataStreamTTSOutputHasNext
Returns whether a streaming TTS data stream has more output chunks available.Parameters
| Parameter | Type | Description |
|---|---|---|
| TTSOutputStream | const FInworldData_DataStream_TTSOutput& | The TTS data stream to check |
Returns
Type:bool
GetCurrentWord
Returns the word currently being spoken at the given playback position. ComparesPlaybackInfo.Utterance.PlayedDuration against each word’s StartTime and EndTime from the TTS output timestamps.
Parameters
| Parameter | Type | Description |
|---|---|---|
| PlaybackInfo | const FInworldVoiceAudioPlaybackInfo& | Current playback state, including elapsed duration |
| TTSOutput | const FInworldData_TTSOutput& | The TTS output containing word timestamp data |
Returns
Type:FInworldAudioVoiceWord
GetPhonemeBlends
Calculates phoneme blend weights at the current playback position from a pre-built array of phone spans. Uses the same timing logic asGetVisemeBlends but returns phoneme codes instead of viseme categories. Use this when you need raw phoneme data rather than viseme mappings.
Parameters
| Parameter | Type | Description |
|---|---|---|
| PlaybackInfo | const FInworldVoiceAudioPlaybackInfo& | Current playback state, including elapsed duration |
| PhoneSpans | const TArray<FInworldPhoneSpan>& | Pre-built array of phone spans (from BuildPhoneSpansFromTTSOutput) |
Returns
Type:FInworldPhonemeBlends
GetPhonemeBlendsTTS
Calculates phoneme blend weights directly from a TTS output object and current playback position. CombinesBuildPhoneSpansFromTTSOutput and GetPhonemeBlends in a single call. Use GetPhonemeBlends with a cached span array if performance is a concern.
Parameters
| Parameter | Type | Description |
|---|---|---|
| PlaybackInfo | const FInworldVoiceAudioPlaybackInfo& | Current playback state, including elapsed duration |
| TTSOutput | const FInworldData_TTSOutput& | The TTS output containing phonetic timestamp data |
Returns
Type:FInworldPhonemeBlends
GetRuntimeStruct
Parameters
| Parameter | Type | Description |
|---|---|---|
| ProcessContext | UInworldProcessContext* | The process context to read from |
| Key | const FName& | The runtime data key to look up |
| ScriptStruct | UScriptStruct* | The expected struct type |
| Struct | int32& | Output: the retrieved struct value |
| Successful | bool& | Output: whether the retrieval succeeded |
GetVisemeBlends
Calculates viseme blend weights for the current playback position from a pre-built array of phone spans. Smoothly interpolates between visemes. BuildPhoneSpans once per utterance using BuildPhoneSpansFromTTSOutput and cache it for use each tick.
Parameters
| Parameter | Type | Description |
|---|---|---|
| PlaybackInfo | const FInworldVoiceAudioPlaybackInfo& | Current playback state, including elapsed duration |
| PhoneSpans | const TArray<FInworldPhoneSpan>& | Pre-built array of phone spans (from BuildPhoneSpansFromTTSOutput) |
Returns
Type:FInworldVisemeBlends
GetVisemeBlendsTTS
Calculates viseme blend weights directly from a TTS output object and current playback position. CombinesBuildPhoneSpansFromTTSOutput and GetVisemeBlends in a single call. Use GetVisemeBlends with a cached span array if performance is a concern.
Parameters
| Parameter | Type | Description |
|---|---|---|
| PlaybackInfo | const FInworldVoiceAudioPlaybackInfo& | Current playback state, including elapsed duration |
| TTSOutput | const FInworldData_TTSOutput& | The TTS output containing phonetic timestamp data |
Returns
Type:FInworldVisemeBlends
MakeAudio
Parameters
| Parameter | Type | Description |
|---|---|---|
| Waveform | const TArray<uint8>& | Raw PCM waveform bytes |
| SampleRate | int32 | Sample rate of the audio data |
Returns
Type:FInworldData_Audio
RenderJinjaWithArgMap
Renders a Jinja2 template string using a map of typed argument values. Returnstrue on success and writes the rendered output to OutJinja. Use CreateBooleanJinjaArgument, CreateStringJinjaArgument, etc. to build the argument map.
Parameters
| Parameter | Type | Description |
|---|---|---|
| Template | const FString& | The Jinja2 template string |
| ArgMap | const TMap<FString, FJinjaArgument>& | Map of variable names to typed argument values |
| OutJinja | FString& | Output: the rendered string |
Returns
Type:bool — true if rendering succeeded
RenderJinjaWithJson
Renders a Jinja2 template string using variables supplied as a JSON string. Returnstrue on success and writes the rendered output to OutRender.
Parameters
| Parameter | Type | Description |
|---|---|---|
| JinjaTemplate | const FString& | The Jinja2 template string |
| VariablesJson | const FString& | A JSON object string whose keys map to template variable names |
| OutRender | FString& | Output: the rendered string |
Returns
Type:bool — true if rendering succeeded
TrimLLMOutput
Removes leading and trailing quotes as well as getting rid of double spaces and other artifacts of LLM text generation.Parameters
| Parameter | Type | Description |
|---|---|---|
| LLMOutputString | const FString& | The LLM output string to edit |
| OutTrimmedLLMOutputString | FString& | The result string with spaces and quotes removed |
UnwrapInworldDataHandle
Parameters
| Parameter | Type | Description |
|---|---|---|
| DataHandle | const FInworldDataHandle& | The data handle to unwrap |
| ScriptStruct | UScriptStruct* | The expected struct type |
| Data | int32& | Output: the unwrapped struct value |
| UnwrapSuccessful | bool& | Output: whether the unwrap succeeded |
WrapInworldData
Parameters
| Parameter | Type | Description |
|---|---|---|
| ScriptStruct | UScriptStruct* | The struct type of the data to wrap |
| Data | const int32& | The struct value to wrap (wildcard — accepts any USTRUCT) |
Returns
Type:FInworldDataHandle