Audio: choose a player and a workflow
Players, buses and effects solve different problems. Pick the matching guide and check the signal path.
Choose the task
| Task | Guide |
|---|---|
| Button click, music, starting and pausing | Playback and positional sound |
| Left/right direction and distance to an object | The same guide includes complete, separate 2D and 3D examples |
| Music, effects and interface sliders | Buses and volume |
| Filter, reverb, compressor or signal analysis | Effects and sample capture |
| Time display, rhythm, pause and seek | An audio clock |
| Voice recording from a device | Microphone recording |
| System-provided spoken text | Text to speech |
Follow the signal
An AudioStream is a sound resource. An AudioStreamPlayer creates playback and sends its signal to a bus. The bus applies effects, then its own volume and sends the result to a receiving bus; the route eventually reaches Master and the audio driver.
Several players can share one resource while retaining separate playback positions and pauses. Changes to the resource itself, such as its loop mode, remain shared. Buses are also global to the running project; do not recreate the same chain for every bullet.
First run without external files
The player guide supplies DemoTone.cs and SoundDemo.cs. Create a C# project and a level with a Control root, attach SoundDemo, build and run with F6. Code creates the complete interface and a short test sound. Expect the button to start a tone, pause to retain its position and resume to continue it. If C# builds are not configured yet, start with the first project.
For an existing file, add it to the project, wait for import, assign the resource to Stream and choose Bus. Import and decoding are separate stages: renaming an extension does not convert audio. See audio import for format details.
When nothing is audible
Check the route: Stream assigned → player inside the tree → Play() called → no pause → destination bus and Master unmuted → a listener in the right viewport for 2D/3D → source within range → correct output device. A moving bus meter proves a signal inside the mixer, not working speakers. The Dummy driver mixes data without output to a device.