Class: SoundServerController
Defined in: src/sdk/utils/sound/SoundServer.ts:517
A controller which provides a convenient interface with which to send commands to SoundServer.
Constructors
Constructor
new SoundServerController(
bus
):SoundServerController
Defined in: src/sdk/utils/sound/SoundServer.ts:525
Creates a new instance of SoundServerController.
Parameters
Parameter | Type | Description |
---|---|---|
bus | EventBus | The event bus. |
Returns
SoundServerController
Methods
awaitInitialized()
awaitInitialized():
Promise
<boolean
>
Defined in: src/sdk/utils/sound/SoundServer.ts:534
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.
interrupt()
interrupt(
packet
):void
Defined in: src/sdk/utils/sound/SoundServer.ts:563
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
Parameter | Type | Description |
---|---|---|
packet | Readonly <SoundPacket > | The sound packet to play. |
Returns
void
kill()
kill(
key
):void
Defined in: src/sdk/utils/sound/SoundServer.ts:582
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
Parameter | Type | Description |
---|---|---|
key | string | The key of the sound packet to kill. |
Returns
void
killAll()
killAll():
void
Defined in: src/sdk/utils/sound/SoundServer.ts:598
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
play()
play(
packet
):void
Defined in: src/sdk/utils/sound/SoundServer.ts:542
Requests a sound packet to be played if there is no existing packet with the same key currently being played.
Parameters
Parameter | Type | Description |
---|---|---|
packet | Readonly <SoundPacket > | The sound packet to play. |
Returns
void
playSound()
playSound(
id
):void
Defined in: src/sdk/utils/sound/SoundServer.ts:607
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
Parameter | Type | Description |
---|---|---|
id | string | The ID of the sound atom to play. |
Returns
void
queue()
queue(
packet
):void
Defined in: src/sdk/utils/sound/SoundServer.ts:552
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
Parameter | Type | Description |
---|---|---|
packet | Readonly <SoundPacket > | The sound packet to queue. |
Returns
void
startSound()
startSound(
id
):void
Defined in: src/sdk/utils/sound/SoundServer.ts:616
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
Parameter | Type | Description |
---|---|---|
id | string | The ID of the sound atom to play. |
Returns
void
stop()
stop(
key
):void
Defined in: src/sdk/utils/sound/SoundServer.ts:573
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
Parameter | Type | Description |
---|---|---|
key | string | The key of the sound packet to stop. |
Returns
void
stopAll()
stopAll():
void
Defined in: src/sdk/utils/sound/SoundServer.ts:590
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