surikov / webaudiofont

Use full GM set of musical instruments to play MIDI and single sounds or effects. Support for reverberation and equaliser. No plugins, no Flash. Pure HTML5 implementation compatible with desktop and mobile browser. See live examples.
https://surikov.github.io/webaudiofont/
GNU General Public License v3.0
891 stars 92 forks source link

How to stop or pause audio #87

Closed etayluz closed 2 years ago

etayluz commented 2 years ago

After scheduling a series of notes to play with player.queueWaveTable, how do I pause or stop the audio if need be?

Should I use player.cancelQueue or envelope.cancel? What is the difference?

surikov commented 2 years ago

read old answer https://github.com/surikov/webaudiofont/issues/62

read docs https://surikov.github.io/webaudiofont/npm/src/docs/classes/player.WebAudioFontPlayer.html#cancelQueue https://surikov.github.io/webaudiofont/npm/src/docs/modules/otypes.html#WaveEnvelope