Skip to main content

Class: SoundServerController

A controller which provides a convenient interface with which to send commands to SoundServer.

Constructors

constructor

new SoundServerController(bus): SoundServerController

Creates a new instance of SoundServerController.

Parameters

NameTypeDescription
busEventBusThe event bus.

Returns

SoundServerController

Defined in

src/sdk/utils/sound/SoundServer.ts:525

Methods

awaitInitialized

awaitInitialized(): Promise<boolean>

Waits for the sound server to finish initialization.

Returns

Promise<boolean>

A Promise which fulfills with a value of true when the sound server finishes initialization.

Defined in

src/sdk/utils/sound/SoundServer.ts:534


interrupt

interrupt(packet): void

Requests a sound packet to be played at the earliest opportunity. If there is no existing packet with the same key currently being played, the packet will begin playing immediately. Otherwise, the existing packet will be stopped the next time one of its sound atoms finishes playing, any queued packets with the same key will be discarded, and the new packet will begin playing at that time.

Parameters

NameTypeDescription
packetReadonly<SoundPacket>The sound packet to play.

Returns

void

Defined in

src/sdk/utils/sound/SoundServer.ts:563


kill

kill(key): void

Requests that a sound packet stop playing at the earliest opportunity (the next time one of its sound atoms finishes playing). This also prevents any queued packets with the same key from playing.

Parameters

NameTypeDescription
keystringThe key of the sound packet to kill.

Returns

void

Defined in

src/sdk/utils/sound/SoundServer.ts:582


killAll

killAll(): void

Requests that all currently playing sound packets stop playing at the earliest opportunity (the next time one of their sound atoms finishes playing). This also clears all queued packets.

Returns

void

Defined in

src/sdk/utils/sound/SoundServer.ts:598


play

play(packet): void

Requests a sound packet to be played if there is no existing packet with the same key currently being played.

Parameters

NameTypeDescription
packetReadonly<SoundPacket>The sound packet to play.

Returns

void

Defined in

src/sdk/utils/sound/SoundServer.ts:542


playSound

playSound(id): void

Requests a single sound atom to be played non-continuously. Calling this method is an alias for calling play({ key: id, sequence: id, continuous: false }).

Parameters

NameTypeDescription
idstringThe ID of the sound atom to play.

Returns

void

Defined in

src/sdk/utils/sound/SoundServer.ts:607


queue

queue(packet): void

Requests a sound packet to be queued. If there is no existing packet with the same key currently being played, the packet will begin playing immediately. Otherwise, the new packet will begin playing after the existing packet and any other queued packets with the same key are finished playing.

Parameters

NameTypeDescription
packetReadonly<SoundPacket>The sound packet to queue.

Returns

void

Defined in

src/sdk/utils/sound/SoundServer.ts:552


startSound

startSound(id): void

Requests a single sound atom to be played continuously. Calling this method is an alias for calling play({ key: id, sequence: id, continuous: true }).

Parameters

NameTypeDescription
idstringThe ID of the sound atom to play.

Returns

void

Defined in

src/sdk/utils/sound/SoundServer.ts:616


stop

stop(key): void

Requests that a continuous sound packet stop playing instead of looping the next time its sequence finishes. This also prevents any queued packets with the same key from playing.

Parameters

NameTypeDescription
keystringThe key of the sound packet to stop.

Returns

void

Defined in

src/sdk/utils/sound/SoundServer.ts:573


stopAll

stopAll(): void

Requests that all currently playing continuous sound packets stop playing instead of looping the next time their sequences finish. This also clears all queued packets.

Returns

void

Defined in

src/sdk/utils/sound/SoundServer.ts:590