context.sound
ContextAPI 2A deck of this toolbar's own music, made with Web Audio; it stops when this mount ends.
Call play from an action: browsers start sound only after a click.
| Signature | context.sound(onChange?: (state: SoundState) => void): Sound |
|---|---|
| Take it from | const { sound } = useToolbar(); |
Parameters
| Parameter | Type | Description |
|---|---|---|
onChange | (state: SoundState) => void | Optional. |
Return Value
| Member | Type | Description |
|---|---|---|
play(score, options?) | void | Plays a score from the start, replacing what this deck was playing. |
pause() | void | |
resume() | void | |
stop() | void | |
set(options?) | void | Changes the volume or the room while playing. |
Availability
| Applicable versions | API 2 and higher |
|---|---|
| Bundleware | 0.3.0, build 2026.10.30 |