iOS allows you to play sound using the Web Audio API as a result of user action.
Try putting this code inside some event handler.
var elem = document.getElementById('play'), audioContext = new (window.AudioContext || window.webkitAudioContext), osc = audioContext.createOscillator(); osc.connect(audioContext.destination); if (osc.noteOn) osc.start = osc.noteOn osc.frequency.value = 440; play.addEventListener('click', function() { osc.start(0); }, false);
Kevin ennis
source share