Skip to content

Commit b864c53

Browse files
Create soundInstructions.
1 parent 09176b1 commit b864c53

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## playInstructions
2+
sends a buffer of encoded audio instructions to the audio engine and begins playback immediately.
3+
``` sig
4+
music.playInstructions(0, null);
5+
```
6+
The function does **not** allow normal buffers, a special type of buffer, which the encoding is in hex (hex`` for template).
7+
8+
## Example
9+
Determines when the song is playing.
10+
11+
``` ts
12+
let songPlaying: boolean;
13+
let buf = hex`3049309430940394034`
14+
15+
function enableSongPlaying(enable: boolean) {
16+
songPlaying = enable;
17+
if (enable) music.playInstructions(0, buf);
18+
}
19+
20+
enableSongPlaying(true);
21+
````

0 commit comments

Comments
 (0)