Audio
constAudio:object
Defined in: client/api.d.ts:353
Local Wwise playback. Sounds are named game events (see Audio.playSoundAt on the server for the replicated form); a bank that isn’t resident makes the post silently return 0.
Type Declaration
Section titled “Type Declaration”dialoguePolicy
Section titled “dialoguePolicy”
readonlydialoguePolicy:DialoguePolicy
The server’s Audio.setDialoguePolicy, as this client applies it.
bankFor()
Section titled “bankFor()”bankFor(
event):string
The soundbank this event needs loaded, from the cooked assets’ own RequiredBank.
Parameters
Section titled “Parameters”string
Wwise event name.
Returns
Section titled “Returns”string
The bank name, or “” for an unknown event.
clearMusic()
Section titled “clearMusic()”clearMusic(
event):boolean
Pops a track off the music stack, starting whatever was under it. It cannot restore state-driven score, and the name stays blocked for the session.
Parameters
Section titled “Parameters”string
The event name passed to setMusic.
Returns
Section titled “Returns”boolean
isBankLoaded()
Section titled “isBankLoaded()”isBankLoaded(
bank):boolean
Whether THIS client loaded that bank. The game streams its own banks with the area and reports nothing, so false does not mean an event cannot play.
Parameters
Section titled “Parameters”string
Soundbank name.
Returns
Section titled “Returns”boolean
loadBank()
Section titled “loadBank()”loadBank(
bank):boolean
Loads a soundbank so its events can be posted. Custom banks are read from Phoenix/Content/WwiseAudio/Windows/.
Parameters
Section titled “Parameters”string
Soundbank name without the .bnk extension.
Returns
Section titled “Returns”boolean
True when the call reached the engine; the engine itself reports no result.
playSound()
Section titled “playSound()”playSound(
event,options?):number
Posts an event on the local pawn, i.e. at the listener (no distance falloff).
Parameters
Section titled “Parameters”string
Wwise event name.
options?
Section titled “options?”duration = seconds until it ends itself; stopEvent = terminator override (auto-resolved from the game data when omitted); autoStop = false disables that lookup.
autoStop?
Section titled “autoStop?”boolean
duration?
Section titled “duration?”number
stopEvent?
Section titled “stopEvent?”string
Returns
Section titled “Returns”number
AkPlayingID, or 0 when the post was refused.
playSoundAt()
Section titled “playSoundAt()”playSoundAt(
event,x,y?,z?,options?):number
Posts a spatialized one-shot at a world position.
Parameters
Section titled “Parameters”string
Wwise event name, e.g. “cabbage_explosion” (case-insensitive).
number | Vector3Like
World-space X coordinate.
number
World-space Y coordinate.
number
World-space Z coordinate.
options?
Section titled “options?”duration = seconds until it ends itself; stopEvent = terminator override (auto-resolved from the game data when omitted); autoStop = false disables that lookup.
autoStop?
Section titled “autoStop?”boolean
duration?
Section titled “duration?”number
stopEvent?
Section titled “stopEvent?”string
Returns
Section titled “Returns”number
AkPlayingID for stopSound, or 0 when the post was refused.
setMusic()
Section titled “setMusic()”setMusic(
event,priority?):boolean
Pushes a track onto the game’s music priority stack. Only events that actually contain a Play action work — most “music” event names only flip Wwise states.
Parameters
Section titled “Parameters”string
Music event name (must be unique while pushed).
priority?
Section titled “priority?”number
Stack priority, clamped to -5..5 (default 5 = above the game’s score).
Returns
Section titled “Returns”boolean
setRTPC()
Section titled “setRTPC()”setRTPC(
name,value):boolean
Sets a global Wwise real-time parameter.
Parameters
Section titled “Parameters”string
Wwise RTPC name.
number
New value.
Returns
Section titled “Returns”boolean
setState()
Section titled “setState()”setState(
group,state):boolean
Sets a global Wwise state.
Parameters
Section titled “Parameters”string
Wwise state group.
string
State within the group.
Returns
Section titled “Returns”boolean
stopAll()
Section titled “stopAll()”stopAll():
boolean
Stops every sound in the engine, including the game’s own music and ambience (those mostly re-post on their own). A last resort.
Returns
Section titled “Returns”boolean
stopEventFor()
Section titled “stopEventFor()”stopEventFor(
event):string
The terminator that would be posted for this event, derived from the game’s own soundbanks.
Parameters
Section titled “Parameters”string
Wwise event name.
Returns
Section titled “Returns”string
The stop event’s name, or “” when the event is a one-shot that needs none.
stopOnSelf()
Section titled “stopOnSelf()”stopOnSelf():
boolean
Stops every sound posted on the local pawn — where playSound puts them. The way out of a held/looping event whose id you no longer have.
Returns
Section titled “Returns”boolean
stopSound()
Section titled “stopSound()”stopSound(
playingId):boolean
Stops one playing sound, posting its registered stopEvent first when it has one.
Parameters
Section titled “Parameters”playingId
Section titled “playingId”number
An id returned by playSound/playSoundAt.
Returns
Section titled “Returns”boolean
unloadBank()
Section titled “unloadBank()”unloadBank(
bank):boolean
Unloads a soundbank.
Parameters
Section titled “Parameters”string
Soundbank name.
Returns
Section titled “Returns”boolean