Closed Bug 861591 Opened 7 years ago Closed 7 years ago

"Save the Day" game is stuck on the loading screen with JS TypeError: AudioBufferSourceNode "d.gain is undefined"


(Tech Evangelism Graveyard :: English US, defect)

Not set


(firefox21 unaffected, firefox22 affected, firefox23 affected)

Tracking Status
firefox21 --- unaffected
firefox22 --- affected
firefox23 --- affected


(Reporter: cpeterson, Assigned: ehsan)




(Keywords: regression)

1. Open Firefox's Web Console
2. Load

The game gets stuck on the loading screen. The Web Console reports the following JavaScript TypeError:

  TypeError: d.gain is undefined @

This is a regression in Nightly 22.0a1 build 2013-03-18. Here is the pushlog from build 03-17 to 03-18:

Does this bug look like a content bug or a regression from WebAudio bug 861395? 

Unpacking the minified JS code, it looks the content is expecting AudioContext.createBufferSource() to return an AudioBufferSourceNode object with a `gain` attribute:

  var d = m.createBufferSource();
  d.buffer = c;
  d.gain.value = g; // TypeError: d.gain is undefined!
The log shows ehsan's patch that enable WebAudio by default. Inspecting the minified source, I can see a `mozWriteAudio`, so I suspect this page is using some kind of abstraction over AudioData API and WebAudio to make the game work cross browser. However, it seems to prefer WebAudio when available, hence the issue when we enabled WebAudio.

The AudioBufferSourceNode has no gain attribute anymore since 2012-04-11, so the page should be updated to be spec compliant.

However, Webkit still implements the `gain` attribute on the AudioBufferSourceNode, and it is not listed in the deprecated section in the spec. We should either implement it and add it to the deprecated names section (but it is not a deprecated name at that point, and would be sad), or close this as WONTFIX. Ehsan, thoughts?
Flags: needinfo?(ehsan)
I have posted to public-audio about this:

Hopefully we can get WebKit/Blink to change their implemnetation to drop this attribute.  Anyways, I have contacted the author of this web site using the support email listed there and asked them to fix it on their end.
Assignee: nobody → ehsan
Blocks: webaudio
No longer blocks: 851603
Component: Video/Audio → English US
Flags: needinfo?(ehsan)
Product: Core → Tech Evangelism
Actually we ended up implementing this attribute in bug 871201.

With that patch, the game works fine.
Closed: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 871201
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.