Problems with simple oscillator and Safari on IOS 7

Hi!

I'm desperately trying to have a simple oscillator running on a page with
safari on IOS 7. I thought it should be supported, but after trying
everything, I'm losing hope. It works on chrome, and pretty much everywhere
else web audio is supported.

In fact, I have tried many examples from the web with Safari, none of them
works. Is there a catch with Safari on IOS?

Cheers,

PS : Here is the code I am trying to run :

<!DOCTYPE html><html><head>
  <title></title>
  <script src="js/jquery-2.0.3.min.js"></script></head>
<body style="background:#000; padding:0; margin:0;">

  <button id="play">PLAY</button>

  <script>
    var audioContext, osc
    $('#play').click(function() {
        audioContext = new (window.AudioContext || window.webkitAudioContext);
        osc = audioContext.createOscillator()

        osc.connect(audioContext.destination)
        if (osc.noteOn) osc.start = osc.noteOn
        osc.start(0)
        osc.frequency.value = 440
        $('body').css({'background-color': 'green'})
    })
  </script>
</body>
</html>




-- 

*Sébastien Piquemal*

 -----* @sebpiq*
 ----- http://github.com/sebpiq
 ----- http://funktion.fm

Received on Wednesday, 29 January 2014 17:20:11 UTC