audPlaySound

Plays a sound once and returns a channel handle. Takes sound (sound handle from audLoadSound). Returns a channel handle.

Audio

Parameters & Returns

Parameters

sound Int

Returns

Int

Quick Summary

Plays a sound once and returns a channel handle. Takes sound (sound handle from audLoadSound). Returns a channel handle.

Technical Exegesis...

Plays the specified sound once from the beginning and returns a channel handle that can be used to control playback. Returns 0 if the sound handle is invalid or <= 0.

The sound plays asynchronously and stops automatically when finished. Multiple instances of the same sound can play simultaneously. Use the returned channel handle with audStopChannel, audPauseChannel, or audResumeChannel to control playback.

Example

Example.bam
Local pistolSound:Int = audLoadSound(\"pistol.wav\")

Local channel:Int = audPlaySound(pistolSound)