The Acoustic Echo Cancellation (AEC) template demonstrates how to use our AEC primitive to filter out speaker echo. Without AEC, if you’re not using headphones, the character’s voice may be fed back into the STT input.Documentation Index
Fetch the complete documentation index at: https://dev.docs.inworld.ai/llms.txt
Use this file to discover all available pages before exploring further.
The AEC module works only with the local model and uses CPU processing only.
Run the Template
- Go to
Assets/InworldRuntime/Scenes/Primitivesand play theAECTemplatescene.
- When the game starts, play the two example audio clips (
FarendandNearend).
- Press
Generateto produce the filtered audio. - Then press
Playto hear the result.
Understanding the Template
Structure
- This demo has only one prefab under
InworldController:AEC. It containsInworldAECModule. - When
InworldControllerinitializes, it callsInitializeAsync()on the AEC module (see Primitives Overview). - This creates an
AECFactory, which then creates anAECInterfacebased on the currentAECConfig.

Workflow
Pressing theGenerate button invokes AECCanvas.FilterAudio().
It first converts the two audio clips (Farend and Nearend) into AudioChunks, then calls InworldController.AEC.FilterAudio() to generate the filtered audio.
AECCanvas.cs