Skip to main content

API Reference

All types use the ERP_ / UERP_ / FERP_ prefix and are Blueprint-accessible.

UERP_STTSubsystem — the primary API

Speech-to-text is a machine-global concern (one local mic, one local player), so the primary entry point is a GameInstanceSubsystem you drive directly — no actor or component required. The backend auto-initializes from Project Settings at startup, so in most projects you just bind OnText and call StartListening().

UERP_STTSubsystem* STT = GetGameInstance()->GetSubsystem<UERP_STTSubsystem>();
STT->OnText.AddDynamic(this, &UMyThing::HandleTranscript);
STT->StartListening();

Listening session

MemberKindDescription
StartListening()function → boolOpen the mic and begin transcribing
StopListening()functionStop (transcribes pending audio first)
IsListening()pure → boolSession active?
FlushUtterance()functionTranscribe accumulated audio now
SetConfig(FERP_STTConfig)functionLanguage + VAD tuning; effective immediately
GetConfig()pure → FERP_STTConfigCurrent session config
OnSTTResultevent FERP_STTResultEach completed utterance (already filtered)
OnTextevent FStringTranscript text — bind to LLM.PushText for chaining

Push-to-talk

MemberDescription
SetPushToTalkMode(ERP_PushToTalkMode)AlwaysOn / PushToTalk / PushToSilence
SetPushToTalkActive(bool)Key down (true) / up (false); release also flushes
SetMuted(bool)Mute without stopping the session

Backend & models

MemberDescription
IsBackendInitialized()boolModel loaded and ready
InitializeBackend(Config)boolLoad a model from an explicit backend config
InitializeBackendWithModelFile(FileName)boolLoad a model by filename
OnBackendReady / OnBackendInitFailedBackend load success / failure (message)
GetModelInfo() / GetMemoryUsage()Loaded model description / footprint
GetModelsDirectory() / GetAvailableModelFiles()Models folder / .bin files present
GetSupportedLanguages()TArray<FString>Language codes of the active backend
GetProcessingState() / GetLastError() / GetLastErrorMessage()Diagnostics
GetPendingTranscriptionCount()int32Worker backlog (real-time detection)

UERP_STTComponent — optional wrapper

An optional thin convenience component that forwards to the subsystem and re-broadcasts its events. Use it for drop-in Blueprint setups or to keep the chaining graph symmetric with ElysMind/ElysSpeak. It owns nothing.

MemberKindDescription
Configproperty FERP_STTConfigPushed to the subsystem on StartListening
bAutoStartListeningproperty boolStart on BeginPlay, stop on EndPlay
StartListening() / StopListening() / IsListening()Forward to subsystem
FlushTranscription()functionForward to Subsystem::FlushUtterance
SetConfig() / GetConfig()Config, pushed to subsystem
IsSTTReady() / GetProcessingState() / GetLastErrorMessage()pureBackend diagnostics
OnSTTResultevent FERP_STTResultRe-broadcast from subsystem
OnTextevent FStringRe-broadcast from subsystem

FERP_STTResult

FieldTypeDescription
TranscribedTextFStringThe recognized text
Confidencefloat0.0–1.0 (average token probability)
bIsFinalboolAlways true with the Whisper backend (utterance-based)
ProcessingTimeMsfloatInference time

FERP_STTConfig

FieldTypeDefaultDescription
LanguageCodeFStringen-USLanguage, or auto to detect
MinConfidenceThresholdfloat0.5Drop results below this
bUseVoiceActivityDetectionbooltrueAuto-segment speech into utterances; off = accumulate until FlushTranscription()/StopListening() (push-to-talk style)
VADActivationThresholdfloat0.02Smoothed RMS energy that starts speech
VADDeactivationThresholdfloat0.01Energy below which audio counts as silence (hysteresis)
VADEnergySmoothingfloat0.35EMA factor on the energy (lower = smoother)
SilenceTimeoutSecondsfloat1.5Silence that ends an utterance
MinUtteranceSecondsfloat0.3Discard shorter blips
MaxUtteranceSecondsfloat25Split longer speech into segments
PreRollSecondsfloat0.4Audio kept from before speech onset

UERP_STTSubsystem

GameInstanceSubsystem owning the shared backend and the background transcription worker. Auto-initializes from Project Settings at startup.

MemberDescription
InitializeBackend(Config)boolLoad a model from an explicit backend config
InitializeBackendWithModelFile(FileName)boolLoad a model by filename from the models directory
ShutdownBackend()Unload (joins the worker thread first)
IsBackendInitialized()boolReady state
OnBackendReadyEvent: backend finished loading
OnBackendInitFailedEvent FString: load failed (message for UI)
GetModelInfo()FStringLoaded model description
GetModelsDirectory()FStringAbsolute path of Content/ElysListen/Models
GetAvailableModelFiles()TArray<FString>.bin files present on disk
GetSupportedLanguages()TArray<FString>Language codes of the active backend
GetMemoryUsage()int64Estimated model memory footprint
GetPendingTranscriptionCount()int32Jobs queued on the worker (backlog detection)
GetProcessingState() / GetLastError() / GetLastErrorMessage()Backend diagnostics

UERP_AudioCaptureSubsystem

Lower-level microphone capture, fanned out to consumers. The STT subsystem is its main consumer; you normally don't touch this directly (drive push-to-talk through UERP_STTSubsystem instead). Capture uses the device's native format (queried from the hardware).

UERP_STTSettings (Project Settings → Elys Listen (STT))

SettingDescription
bEnableAudioCaptureProject-wide microphone kill-switch
bEnableSTT / STTBackendEnable and choose the backend (Whisper by default)
STTModelPathModel file; stored project-relative, resolved by ResolveModelPath()
DefaultLanguageCodeLanguage used at auto-initialization
WorkerThreadCountInference threads (0 = auto)
bEnableGPUAccelerationOnly with a GPU-enabled whisper.cpp build (bundled lib is CPU-only)
STTModelCatalogThe model list shown in the downloader
bEnableVerboseLoggingDetailed VAD/transcription diagnostics

IERP_STTBackend

Implement this to add a custom STT engine (e.g. Vosk, Moonshine), then select Custom as the backend in settings. Whisper is the bundled implementation (UERP_WhisperBackend). The primary entry point is TranscribeSamples(Samples16kMono, Config, OutResult) — it must be thread-safe (called from the transcription worker).