Skip to content
ASArcaneMP Scripting APIScripting reference
Global objectServer APIGenerated

Audio

const Audio: object

Defined in: server/api.d.ts:3308

Replicated sound. A sound is a Wwise event NAME — every event the game ships (~6,300, e.g. “cabbage_explosion”, “UI_Menu_Select”, “Amb3D_Storm_ThunderClaps_Play”) works out of the box, and custom banks dropped in Phoenix/Content/WwiseAudio/Windows/ work once loadBank() names them. Posting an event whose bank isn’t resident is silently inaudible.

readonly dialoguePolicy: DialoguePolicy

Whose native spoken lines every client lets through (see setDialoguePolicy). Each speaker reads true (every line, the default), “nonverbal” or false.

readonly mutedEvents: string[]

The Wwise events every client refuses to play (see setMutedEvents), lowercased.

bankFor(event): string

The soundbank this event needs loaded, from the cooked assets’ own RequiredBank. Clients load it automatically when a post is refused, so this is for diagnostics and preloading.

string

Wwise event name.

string

The bank name, or “” for an unknown event.

clearMusic(event): void

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.

string

The event name passed to setMusic.

void

loadBank(bank): void

Loads a soundbank on every client; clients that aren’t in-world yet retry until they are.

string

Soundbank name, without the .bnk extension.

void

playSoundAt(event, x, y?, z?, options?): number

Plays a spatialized one-shot at a world position on every client in range.

string

Wwise event name (case-insensitive).

number | Vector3Like

World-space X coordinate.

number

World-space Y coordinate.

number

World-space Z coordinate.

range = cm within which clients are sent the post (default 10000, 0 = everyone); bank = soundbank to load first; duration = seconds until it ends itself; stopEvent = authored terminator posted when it ends; virtualWorld and map = only the players in that world of that map hear it, map being a player.location().areaId (left out, every player in range does, whatever their world).

string

number

string

number

string

number

number

A sound id for stopSound, or 0 when the event name was empty.

playSoundForAll(event, options?): number

Plays a sound at every connected player’s listener, wherever they are.

string

Wwise event name.

bank = soundbank to load first; duration = seconds until it ends itself; stopEvent = authored terminator posted when it ends.

string

number

string

number

A sound id for stopSound.

playSoundForPlayer(player, event, options?): number

Plays a sound at one player’s listener — private, with no distance falloff.

Player

The only recipient.

string

Wwise event name.

bank = soundbank to load first; duration = seconds until it ends itself; stopEvent = authored terminator posted when it ends.

string

number

string

number

A sound id for stopSound, or 0 when the player is gone.

playSoundOnObject(object, event, options?): number

Plays a sound attached to a world object: it moves with the object on every client and stops when the object is destroyed or streams out. Heard by the players who have the object streamed in and on screen when the post arrives; one who streams it in later does not get it, so a sound for the object’s whole life belongs in WorldObject.create’s sound instead.

number | WorldObject

World object (or its network id) whose actor the sound follows.

string

Wwise event name.

socket = mesh socket it rides, up to 64 characters (omitted or missing on the mesh: the object’s root, or a skeletal mesh’s Head bone when it has one); the rest as playSoundAt.

string

number

string

string

number

A sound id for stopSound, or 0 when the object is gone, the event name was empty or the socket name too long.

playSoundOnPlayer(player, event, options?): number

Plays a sound attached to a player, heard by everyone in range who shares their virtual world and map, including them.

Player

Player whose body the sound follows.

string

Wwise event name.

Same options as playSoundAt.

string

number

number

string

number

A sound id for stopSound, or 0 when the player is gone.

setDialoguePolicy(policy): boolean

Mutes the game’s own spoken lines on every client, by who says them: player (each client’s own character: spell incantations, mount and exploration remarks, grunts), players (other players’ bodies), npcs (NPC.create), characters (Character.create), world (the game’s own people, such as townsfolk, students, vendors and ghosts, and lines posted at a spot) and floo (the Floo Network’s announcer). A muted line never starts: no sound, no subtitle, no lip movement. Clients raise dialogueMuted for each one, so a script can play a replacement. Players who join later get the policy too.

Partial<DialoguePolicy>

Per speaker: true lets every line play, “nonverbal” only the grunts, breaths, laughs and gasps, false none. Speakers left out keep their setting.

boolean

False for a non-object, an unknown speaker or a value other than true, false or “nonverbal”; nothing changes then.

setMusic(event, priority?): void

Pushes a track onto every client’s music priority stack. Only events that actually contain a Play action work — most “music” event names only flip Wwise states.

string

Music event name (must be unique while pushed).

number

Stack priority, clamped to -5..5 (default 5 = above the game’s score).

void

setMutedEvents(events): string[]

Mutes Wwise events on every client: each post of one is refused, the game’s own and those of Audio’s play functions alike, and what they are already playing fades out. For the game’s own sounds no other switch reaches, such as the castle’s ambience bed (amb_2d_hogwarts_lerp_location_loop_start), which carries the Great Hall’s chatter at mealtimes. Unmuting an event plays it again on whatever it was playing on when it was muted; a post the game made while it was muted stays refused. Replaces the whole list; players who join later get it too. Throws a TypeError for a non-array or an entry that is not a non-empty string, and a RangeError for more than 64 distinct events; the list stays as it was then.

string[]

Wwise event names (case-insensitive), at most 64. An empty array lets every event play again.

string[]

The list as applied: lowercased and deduplicated, in the order given.

setRTPC(name, value): void

Sets a global Wwise real-time parameter on every client.

string

Wwise RTPC name.

number

New value.

void

setState(group, state): void

Sets a global Wwise state on every client.

string

Wwise state group.

string

State within the group.

void

stopAll(): void

Stops every sound on every client, including the game’s own music and ambience (those mostly re-post on their own). The way out of a held/looping event nobody holds an id for.

void

stopAllSounds(): void

Old name of stopAll.

void

Use stopAll, the name the client’s Audio has.

stopEventFor(event): string

The terminator that would be posted for this event, derived from the game’s own soundbanks.

string

Wwise event name.

string

The stop event’s name, or “” when the event is a one-shot that needs none.

stopSound(soundId): boolean

Stops that sound on every client that started it.

number

An id returned by one of the play functions.

boolean

True when the stop was broadcast.

unloadBank(bank): void

Unloads a soundbank on every client.

string

Soundbank name.

void