[Webkit-unassigned] [Bug 132691] HTMLAudioElement doesn't play with Javascript on mobile WebKit (Safari and Chrome on iPad/iPhone/Android) 7)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 9 23:07:45 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=132691





--- Comment #6 from Hugo <lebegue_h at yahoo.com>  2014-05-09 23:08:07 PST ---
Hi Jer,

Thank you for your patience with me on this. I have implemented the WebAudio for Webkit, and could successfully run it on Android+Chrome, but can not run it on iPad/iPhone with Chrome and Safari (i spoke too fast :-( )


I trigger the javascript code upon a user interaction (touch on the screen). The function does
1- creates the audio context (only once) 
  if (window.webkitAudioContext) {
    myaudioContext = new webkitAudioContext();
  } else if (window.AudioContext) {
    myaudioContext = new AudioContext();
  }

2- on the same call the call loads a collection of 4 sounds (only once, and using a BufferLoader class (XHR, base64 MP3 files from local URL) onto an array called sounds. 

3- The function sets a repeatable timer (3 seconds) and returns from the function.   

4- In parallel, the timer selects a song randomly from the pre-loaded songs list and play the song using 
  var source = myaudioContext.createBufferSource();
  source.buffer = songs[random].buffer;
  source.connect(myaudioContext.destination);

  if (!source.start) source.start = source.noteOn;
  source.start(0);

I tried adding
  try{
    myaudioContext.startRendering();
  }catch (ex){};
but it did not help 

The code executes just fine, but no sound comes out of the speaker. 

The use case is fairly trivial. This works on all windows browsers (FF, Safari,), on Mac browsers (Chrome, Safari and Firefox) and mobile tablets like Chrome on Nexus/Android OS. => But it doesn't work on WebKit on iOS (iPad and iPhone).

The parsing of the MP3 files work just fine, in fact, I can create an <audio> element in the HTML, and when I click on it, play the song just fine, so I believe the MP3 is encoded properly, and decoded by the context just fine.

I am puzzled by this problem.  

Thank you for taking the time to help me. I can give you an url for testing privately upon request.

Best regards

Hugo

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list