Crashes in WebKit and Firefox Nightlies due to WebAudio API issues
Closed this issue · 2 comments
BonsaiDen commented
The three offending lines:
- https://github.com/ttencate/jfxr/blob/master/src/player.js#L25
- https://github.com/ttencate/jfxr/blob/master/src/player.js#L41
- https://github.com/ttencate/jfxr/blob/master/src/player.js#L53
Turns out the first one currently requires the BufferSize
(at least in WebKit) and the latter two also require at least the when
argument to be present.
Setting the buffer to 1024
and passing 0
as the first parameter to this.source.start()
and this.source.stop()
made it work in both browsers.
For reference:
- https://developer.mozilla.org/en-US/docs/Web/API/AudioContext.createScriptProcessor (See the red warning box regarding Webkit)
- https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode (There's no Note on this, however without any arguments it still crashes)
ttencate commented
Thank you so much for filing this before the nightlies see the light of day and break it for everyone! I mostly worked off of the WebAudio spec directly (http://www.w3.org/TR/webaudio/) which clearly mentions bufferSize as optional, as well as the when argument to start() and stop(). Sigh.
ttencate commented
Forgot to say: another big THANK YOU for taking the trouble to debug this and find the solution!