Overview
The Play Audio and Stop Audio actions manage audio playback. Use Play Audio to trigger narration, sound effects, or ambient audio. Use Stop Audio to silence audio clips or stop looping sounds. Multiple audio clips can play simultaneously, allowing you to layer narration over ambient sound or play multiple sound effects at once.Play Audio
When to Use
- Narration: voice-over instructions or explanations
- Sound effects: feedback tones, alert sounds, or interaction sounds
- Ambient audio: background music or environmental sounds
- Audio cues: alert the learner to important information
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Audio Asset | string | Yes | Select an audio file from your asset library. |
| Loop | boolean | No | Set to true to loop the audio continuously. Default is false (play once). |
| Volume | number | No | Set the volume level from 0 to 1, where 0 is silent and 1 is full volume. Default is 1. |
Key Behavior
- Fire and forget: Play Audio actions start the audio and the action completes immediately; subsequent actions don’t wait for the audio to finish.
- Simultaneous playback: You can add multiple Play Audio actions to the same action list, and they will all play at once.
- Action ID tracking: Each Play Audio action is assigned an ID that you can reference in Stop Audio actions if you need to stop that specific audio.
Stop Audio
When to Use
- Interrupt narration: stop a narration clip if the learner advances before it finishes
- Ambient sound cleanup: stop looping ambient audio when exiting a state
- Layered audio: stop one audio clip while another continues
- Audio fallback: if audio is playing unexpectedly, stop it
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Target Action ID | string | No | (Optional) Reference the ID of a specific Play Audio action to stop only that clip. If omitted, all playing audio stops. |
Key Behavior
- Omnibus stop: If no Target Action ID is provided, Stop Audio stops all currently playing audio.
- Selective stop: If you specify a Target Action ID, only that audio clip stops; other audio continues.
- Safe to call on silent: Calling Stop Audio when no audio is playing has no effect.
Practical Examples
Narration with Delay
Scenario: Play a 3-second narration, then show a text prompt. The learner should not see the prompt until narration is done.In a state’s
onEntry action list:- Play Audio: select
narration_step1.mp3 - Delay:
3000(milliseconds, matching narration duration) - Show Prompt: display interaction instructions
Looping Ambient Sound
Scenario: A factory floor training state should have background machinery noise while learners work.In the FactoryFloor state’s
onEntry:- Load Scene:
factory_floor_main - Play Audio:
machinery_ambient.mp3, Loop:true, Volume:0.3
Stop Interrupted Narration
Scenario: Learner clicks “skip” or advances before narration finishes.In the
onEntry action list, give your Play Audio action a memorable name/ID in the system (e.g., narration_main).Create a transition triggered by a “skip” button:
- Stop Audio: Target Action ID:
narration_main - Training Navigation or transition to next state
Audio plays from the system’s default audio output. If the learner’s device is muted, no sound will be heard. Some trainings may require captions or text alternatives for accessibility.

