No sound resulting from this code, also no error is thrown: https://output.jsbin.com/mogudag 'use strict'; const handleError = (e) => { const pre = document.createElement('pre'); pre.style.color = 'red'; pre.textContent = `Error: ${e}\n.message: ${e.message}\n.stack: ${e.stack}`; document.body.appendChild(pre); }; window.addEventListener('error', ({ error }) => handleError(error)); window.addEventListener('unhandledrejection', ({ reason }) => handleError(reason)); (async () => { try { await new Promise(resolve => window.addEventListener('load', resolve)); const ctx = new (window.webkitAudioContext || window.AudioContext)(); const oscNode = ctx.createOscillator(); oscNode.connect(ctx.destination); oscNode.start(); } catch (e) { handleError(e); } })();
Tested on iPhone with iOS beta 4 and iPad with iOS beta 5.
<rdar://problem/33818985>
Does this start to work for you if triggered from a user interaction (tap?).
For instance, https://output.jsbin.com/yuhobukuji
Ah it does work with user interaction. Didn't think that kind of restriction applied for web audio. Thanks.