3 ms·
It got renamed from JavaScriptNode to ScriptProcessor when it switched from webkitAudioContext to AudioContext, and it seems to be the best-supported way to do
by a1k0n 11y ago
It got renamed from JavaScriptNode to ScriptProcessor when it switched from webkitAudioContext to AudioContext, and it seems to be the best-supported way to do it. I don't see why not. But of course IE doesn't support it at all and I don't think iOS Safari does either (it's a big question mark on mozilla.org anyway)
- a1k0n 11y agoOn second thought you're probably right; this API will probably break in a couple years and my player won't work anymore, just like everything else that tried to use createJavaScriptNode in the past is now broken. Hopefully the web workers transition is the last...
- greggman 11y agoiOS safari supports it just fine and has since it first came out. http://games.greggman.com/game/html5-bytebeat/ http://games.greggman.com/game/html5-bytebeat/ The issue on mobile is you can only start playback of sounds in a user gesture event and I think on iOS the first sound can't be a ScriptProcessorNode (maybe that bug was fixed). I just play an oscillator for a moment to get things started. Once the first note is played it just all works. I'd be surprised if they removed it at this point. Many many pages use it. Many many native->emscripten apps use it. I think just no one has updated MDN in a while. Unity->HTML5 uses it. Unreal->HTML5 uses it. Pico8->HTML5 uses it. Voxatron->HTML5 uses it.
- a1k0n 11y agoedit: THANK YOU! That was the issue; I had to make a dummy oscillator. And, separately, there was a CSS issue which made the buttons black on black. Now it works on iOS.