[Webkit-unassigned] [Bug 132852] New: WebAudio doesn't play sound followng User Interaction on iOS+Safari

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 12 20:58:15 PDT 2014


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

           Summary: WebAudio doesn't play sound followng User Interaction
                    on iOS+Safari
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: iOS
        OS/Version: iOS 7.0
            Status: NEW
          Severity: Blocker
          Priority: P1
         Component: Web Audio
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: lebegue_h at yahoo.com
                CC: crogers at google.com


Hi team,

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 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, loads the sound sounds (only once, using a BufferLoader class (XHR, base64 MP3 files from local URL) onto an array called letters. 

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

4- In parallel, the timer selects the song 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 the code below (thanks Jer) 
  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, Chrome), on Mac browsers (Chrome, Safari and Firefox) and mobile tablets with Chrome on Nexus/Android OS. => But it doesn't work on Safari and Chrome 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'm attaching the test case here. 

Thank you for your support. 

Best regards

Hugo

PS: Sorry it took me a bit to log this case, so this might seem redundant with https://bugs.webkit.org/show_bug.cgi?id=132691

-- 
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