Why Does The Stop Method In AudioBufferNode Destroy It?
We know that when you invoke #.stop() on an AudioBufferNode, you cannot then #.start(). Why is the behavior so? This issue came up when playing around with WebAudio API as we all f
Solution 1:
You're not calling .stop() on an AudioBuffer, you're calling .stop() on a BufferSourceNode - the AudioBuffer can be used multiple times.
The short version is it's an optimization that allows for fire-and-forget playback of buffers in a very lightweight way - you can build a higher level media player around it, but in and of itself BufferSourceNodes are very lightweight. The sound data itself is not forgotten, and can be reused - in fact, used simultaneously by other BufferSourceNodes - because it's in the separate AudioBuffer object.
Baca Juga
- Web Audio Api Analyser Node Getbytefrequencydata Returning Blank Array
- Web Audio Analyser's Getfloattimedomaindata Buffer Offset Wrt Buffers At Other Times And Wrt Buffer Of 'complete File'
- Is There A Way Get Something Like Decibel Levels From An Audio File And Transform That Information Into A Json Array?
Post a Comment for "Why Does The Stop Method In AudioBufferNode Destroy It?"