Open Bug 1204871 Opened 6 years ago Updated 6 years ago

Web Audio API issue with Ajax call


(Core :: Web Audio, defect, P5)

40 Branch




(Reporter: madan.prajapati, Unassigned)




(1 file)

365.84 KB, application/x-zip-compressed
Attached file
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0
Build ID: 20150826023504

Steps to reproduce:

We have encountered an issue in the latest Firefox stable release 40.x series. We have created an application which uses the WebAudio API to play the audio files in sequence.  The application is loading JSON files which have the list of audio files need to be played within the game. These games exist in a series which would be loaded dynamically and each of the game get the associated assets from these JSON files. 

We have used the AJAX call to load the game data and the same time loading to all associated audio files list in arraybuffer format for one-by-one playback.

Now the issue when we are using AJAX calls in “ASYNC” mode with parameter “false” then the WebAudio API is not playing the audio sequence BUT works absolutely fine when using AJAX calls in “ASYNC” mode with parameter “true” 

We have created a sample of the same. This sample has two HTML files - :

(1)	“index_false.html” which uses AJAX calls in “ASYNC” mode with parameter “false”

(2)	 “index_true.html” which uses AJAX calls in “ASYNC” mode with parameter “true”

Both of the files are using the same source code EXCEPT “ASYNC” parameters – “true/false” 

Please use the attached zip file to refer these two HTML files (index_false.html, index_true.html)

Actual results:

When we load “index_false.html” in Firefox 40.x the WebAudio API does not work and when we load “index_true.html” the same WebAudio API works fine.

Expected results:

In Firefox 40.x the WebAudio API should work with AJAX calls in “ASYNC” mode regardless of parameter - true or false

Please NOTE that this issue is never reproducible on Firefox 39.x version or earlier. 
Look forward to hearing a response from Firefox development team. This is really a critical issue for us.
It's fixed by bug 1201393 in FF43, you can test yourself by installing Nightly.
Closed: 6 years ago
Component: Untriaged → Audio/Video
Depends on: 1201393
Product: Firefox → Core
Resolution: --- → WORKSFORME
Loic, did you do some testing to determine this? It's not obvious to me why it would have fixed it, but it might very well have.
Flags: needinfo?(epinal99-bugzilla2)
I used mozreg after testing in the daily Nightly.
Flags: needinfo?(epinal99-bugzilla2)
Fabulous, thanks.

Thanks guys for a quick response and resolution on this. We've checked this on nightly build of version 43.0 today.

In first attempt this worked fine but later navigating again the same request multiple times was breaking up the audio playback.

We tried this on other systems with the same nightly build but same instance observed. 

Somehow the in the nightly 43.0 build, the WebAudio API is working intermittently with AJAX calls in “ASYNC” mode with parameter "false". There is no impact when used "true".

Could you please suggest an alternative or this is something you guys are already working on ?

Thanks for your response, look forward to hear your reply.
Resolution: WORKSFORME → ---
Synchronous AJAX call is a deprecated feature of the web platform and hurts you performance badly, please don't use it.

Having the Web Audio API working with synchronous XHR is very low priority for us.
I'm going to call this a Web Audio bug.
Component: Audio/Video → Web Audio
Ever confirmed: true
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.