MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / play

Function play

examples/drivers/m5atom-echo/main.js:46–52  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

44}
45
46function play(index) {
47 speaker.stop();
48 speaker.enqueue(0, AudioOut.Flush);
49 speaker.enqueue(0, AudioOut.Samples, new Resource(clips[index] + ".maud"));
50 speaker.enqueue(0, AudioOut.Callback, 0);
51 speaker.start();
52}
53
54const value = [0, 0, 0];
55let step = 15;

Callers 1

main.jsFile · 0.70

Calls 3

stopMethod · 0.65
startMethod · 0.65
enqueueMethod · 0.45

Tested by

no test coverage detected