Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web Audio API: noteOn after noteOff not working?

I wrote a simple web app using the Web Audio API, but I've noticed that when I issue a noteOn(0) command to a given source, followed by a noteOff(0), and then finally by another noteOn(0) command, the sound will turn on, turn off (as expected) but then won't turn on with the third command.

Is there something that I'm doing wrong? It's as simple as that, I can show you code but I feel it's redundant. Perhaps I need to reassign the buffer to the source after the noteOff, but I can't imagine that's how it was intended to be used.

like image 280
nct25 Avatar asked Jul 03 '12 04:07

nct25


1 Answers

AudioBufferSourceNode can only be played once.

http://youtu.be/hFsCG7v9Y4c?t=18m22s

like image 164
krivinarius Avatar answered Sep 22 '22 12:09

krivinarius