STTNode.
Run the Template
- Go to Assets/InworldRuntime/Scenes/Nodesand play theSTTNodescene. 
- Once the graph is compiled, speak into the microphone to generate text.

Understanding the Graph
You can find the graph on theInworldGraphExecutor of STTCanvas.

STTNode, with no edges.
STTNode is both the StartNode and the EndNode.

InworldController
TheInworldController is also simple; it contains only one primitive module: STT.

For details about the primitive module, see the STT Primitive Demo.
InworldAudioManager
InworldAudioManager handles audio processing and is also modular.
In this demo, it uses four components:
- AudioCapturer: Manages microphone on/off and input devices. Uses Unity’s Microphoneby default, and can be extended via third‑party plugins.
- AudioCollector: Collects raw samples from the microphone.
- PlayerVoiceDetector: Implements IPlayerAudioEventHandlerandICalibrateAudioHandlerto emit player audio events and decide which timestamped segments to keep from the stream.
- AudioDispatcher: Sends the captured microphone data for downstream processing.

Workflow
Audio Thread: At startup, the microphone calibrates to background noise.PlayerVoiceDetector listens for speech using SNR (Signal‑to‑Noise Ratio).
When it exceeds the threshold, AudioDispatcher streams audio frames to InworldAudio.
Main Thread:
- When the game starts, InworldControllerinitializes its only module,STTModule, which creates theSTTInterface.
- Next, InworldGraphExecutorinitializes its graph asset by calling each component’sCreateRuntime(). In this case, onlySTTNode.CreateRuntime()is called, using the createdSTTInterfaceas input.
- After initialization, the graph calls Compile()and returns the executor handle.
- After compilation, the OnGraphCompiledevent is invoked. In this demo,STTNodeTemplatesubscribes to it and enables the UI components. Users can then interact with the graph system.
STTNodeTemplate.cs
- When AudioDispatchersends data,STTNodeTemplatehandles itsOnAudioSentevent with theSendAudio()function, converting theList<float>audio data intoInworldAudio.
STTNodeTemplate.cs
- Calling ExecuteGraphAsync()eventually produces a result and invokesOnGraphResult(), whichSTTNodeTemplatesubscribes to in order to receive the data.
STTNodeTemplate.cs