jussi-kalliokoski/audiolib.js — Issue #50: best way to stop playing audio
Author: kindohm
Created: 2012-03-05 16:04:24+00:00
State: open

What is the best way to stop (either temporarily or permanently) playing audio? So far in my code I've used something like this:

```javascript
var callback = audioCallback(buffer, channels) {
if (playing) {
osc.append(buffer, channels);
}
};

$(button).click(function () { playing = !playing; }
```

Is there a better or more formal way to stop the audio? With this method, audioCallback still gets called.