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
Name | Type | Description |
---|---|---|
bus | EventBus | The event bus. |
Returns
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
Name | Type | Description |
---|---|---|
packet | Readonly <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
Name | Type | Description |
---|---|---|
key | string | The 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
Name | Type | Description |
---|---|---|
packet | Readonly <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
Name | Type | Description |
---|---|---|
id | string | The 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
Name | Type | Description |
---|---|---|
packet | Readonly <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
Name | Type | Description |
---|---|---|
id | string | The 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
Name | Type | Description |
---|---|---|
key | string | The 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