Closed
Bug 779297
(webaudio)
Opened 12 years ago
Closed 11 years ago
Implement and ship Web Audio
Categories
(Core :: Web Audio, defect)
Core
Web Audio
Tracking
()
RESOLVED
FIXED
mozilla25
Tracking | Status | |
---|---|---|
relnote-firefox | --- | 25+ |
People
(Reporter: roc, Assigned: ehsan.akhgari)
References
(Depends on 1 open bug, Blocks 1 open bug, )
Details
(Keywords: feature, meta, Whiteboard: [games:p1][tech-p1])
Tracking bug.
Assignee | ||
Updated•12 years ago
|
Alias: webaudio
Comment 1•12 years ago
|
||
I have created a MozillaWiki article for the W3C Web Audio API: https://wiki.mozilla.org/Web_Audio_API
Updated•12 years ago
|
Whiteboard: [games:p?]
Updated•12 years ago
|
Whiteboard: [games:p?] → [games:p1]
Comment 2•12 years ago
|
||
All the child bugs here are fixed. What's the status of this API implementation?
Updated•12 years ago
|
OS: Windows 7 → All
Hardware: x86_64 → All
Assignee | ||
Comment 3•12 years ago
|
||
(In reply to comment #2)
> All the child bugs here are fixed. What's the status of this API
> implementation?
It's long ways away. Not all of the actual portions have been filed now. I've been mostly filing bugs for things that I have in-flight patches for.
Assignee: nobody → ehsan
Comment 4•12 years ago
|
||
Just wondering... but when will this be avaliable for Firefox users?
Comment 5•12 years ago
|
||
(In reply to Jessica_XY from comment #4)
> Just wondering... but when will this be avaliable for Firefox users?
There's no particular target set at this point. Sometime next year, probably.
Assignee | ||
Comment 6•12 years ago
|
||
(In reply to comment #4)
> Just wondering... but when will this be avaliable for Firefox users?
We're working on it, it's still not clear which version will enable this by default.
Updated•12 years ago
|
Blocks: b2g-v-next
Major content use case and needed for competitive parity.
Whiteboard: [games:p1] → [games:p1][tech-p1]
Assignee | ||
Comment 9•12 years ago
|
||
(In reply to comment #8)
> Major content use case and needed for competitive parity.
Do we have a detailed set of requirements for b2g? Web Audio is a huge API and we're currently working to determine the list of nodes we're going to implement first. The proposed list is currently available at <https://etherpad.mozilla.org/webaudio> and it would be great if b2g folks could give us feedback on the prioritization proposed there. Thanks!
The two use cases I know are very simple. I'm not an expert on this, so I'm going to wave my hands
- multi-shot API for playing back sounds (bug 674080). I don't know how this overlaps with WebAudio, or what nodes that would correspond to.
- generating infinite sine-wave tones, mixing two tones into one channel, and applying ADSR. This is used to generate key-pad tones.
Beyond that, b2g is shooting for parity with android audio processing APIs, so that's the next place I would look.
Comment 11•12 years ago
|
||
In b2g, Music and Videp apps can use WebAudio. The apps can play music with audio effect.
Assignee | ||
Comment 12•12 years ago
|
||
(In reply to comment #10)
> The two use cases I know are very simple. I'm not an expert on this, so I'm
> going to wave my hands
> - multi-shot API for playing back sounds (bug 674080). I don't know how this
> overlaps with WebAudio, or what nodes that would correspond to.
In Web Audio you can decode the audio in a buffer and play it as many times as you like.
> - generating infinite sine-wave tones, mixing two tones into one channel, and
> applying ADSR. This is used to generate key-pad tones.
Web Audio lets you do that but I think doing that in software for the key-pad tones is a mistake. We can just record the audio and play it back from a file.
> Beyond that, b2g is shooting for parity with android audio processing APIs, so
> that's the next place I would look.
Which APIs are those exactly? I'm not familiar with Android audio APIs at all.
Assignee | ||
Comment 13•12 years ago
|
||
(In reply to comment #11)
> In b2g, Music and Videp apps can use WebAudio. The apps can play music with
> audio effect.
What types of effects?
Comment 14•12 years ago
|
||
(In reply to :Ehsan Akhgari from comment #12)
> > - generating infinite sine-wave tones, mixing two tones into one channel, and
> > applying ADSR. This is used to generate key-pad tones.
>
> Web Audio lets you do that but I think doing that in software for the
> key-pad tones is a mistake. We can just record the audio and play it back
> from a file.
If this is for user feedback, you shouldn't use real DTMF tones in the first place. In e.g., WebRTC, the real DTMF data is conveyed in RFC 4733 RTP packets and any tones that are played are just candidates for double-detection and other confusion on the receiving end. So you could even use the same file for every key.
Yes, the tones are audio played for user feedback, not what's sent over the wire. I'll have to let the authors of the current code speak to the issues they ran into.
Comment 16•12 years ago
|
||
I was trying this code snippet with FF Nightly https://gist.github.com/automata/5174277 but I'm getting an error about the number of arguments for mozAudioContext.createBuffer.
Beside this, is anyone working on testing currently Web Audio API spec with the one implemented on FF? Any plans on how to do that? I want to help.
Thanks guys.
Assignee | ||
Comment 17•12 years ago
|
||
(In reply to Vilson Vieira from comment #16)
> I was trying this code snippet with FF Nightly
> https://gist.github.com/automata/5174277 but I'm getting an error about the
> number of arguments for mozAudioContext.createBuffer.
There are two versions of createBuffer, one which just creates a buffer and one that decodes audio on the main thread. You're trying to use the second version which we have not implemented yet. Bug 848652 is on file for that. In the mean time, you can rework your sample to use the asynchronous version of this API, decodeAudioData which we implement and is better since it won't block the main thread any way.
> Beside this, is anyone working on testing currently Web Audio API spec with
> the one implemented on FF? Any plans on how to do that? I want to help.
I am actively involved in the spec discussions. What kinds of things are you interested to help with? I'm sure we could use more hands here. :-)
Comment 18•12 years ago
|
||
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #17)
> There are two versions of createBuffer, one which just creates a buffer and
> one that decodes audio on the main thread. You're trying to use the second
> version which we have not implemented yet. Bug 848652 is on file for that.
Ehsan, thank you, I'll try decodeAudioData instead.
> I am actively involved in the spec discussions. What kinds of things are
> you interested to help with? I'm sure we could use more hands here. :-)
I can help testing the Web Audio API implementation (I don't know what is the best way to do that, maybe trying available examples like http://chromium.googlecode.com/svn/trunk/samples/audio/index.html and reporting the status?) and try to help on dev as much as I can. Well, use my hands :-)
Assignee | ||
Comment 19•12 years ago
|
||
(In reply to comment #18)
> > I am actively involved in the spec discussions. What kinds of things are
> > you interested to help with? I'm sure we could use more hands here. :-)
>
> I can help testing the Web Audio API implementation (I don't know what is the
> best way to do that, maybe trying available examples like
> http://chromium.googlecode.com/svn/trunk/samples/audio/index.html and reporting
> the status?) and try to help on dev as much as I can. Well, use my hands :-)
Testing the existing Web IDL implementation will be a _huge_ help! Note that at this stage there are large parts of the Web Audio APIs that we don't implement yet. Unfortunately the best way to tell what has been implemented so far is to look in <http://mxr.mozilla.org/mozilla-central/source/dom/webidl/> for files named like [interfaceName].webIDL (for example, <http://mxr.mozilla.org/mozilla-central/source/dom/webidl/AudioContext.webidl>) and look at the properties and methods on those interfaces. Reporting issues caused by things which we are not implementing yet is generally not very helpful since we're already well aware of those, but reporting issues with the things that we currently implement is extremely helpful (bug 846329 is my favorite example so far!)
As far as different node types, we have the DOM bindings implemented for a whole bunch of them, but most are not hooked up to anything yet. The node types that are currently implemented and should work fine are AudioBufferSourceNode, AudioDestinationNode and AudioGainNode. More is coming along shortly, of course, so please continue watching this bug. :-)
If you're interested in hacking on the implementation itself and have experience writing C++ code, please let me know and I would be happy to help you find a good place to start! And please ask questions if anything is not clear to you. Thanks!
Comment 20•12 years ago
|
||
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #19)
> (In reply to comment #18)
> > > I am actively involved in the spec discussions. What kinds of things are
> > > you interested to help with? I'm sure we could use more hands here. :-)
> >
> > I can help testing the Web Audio API implementation (I don't know what is the
> > best way to do that, maybe trying available examples like
> > http://chromium.googlecode.com/svn/trunk/samples/audio/index.html and reporting
> > the status?) and try to help on dev as much as I can. Well, use my hands :-)
>
> Testing the existing Web IDL implementation will be a _huge_ help! Note
> that at this stage there are large parts of the Web Audio APIs that we don't
> implement yet. Unfortunately the best way to tell what has been implemented
> so far is to look in
> <http://mxr.mozilla.org/mozilla-central/source/dom/webidl/> for files named
> like [interfaceName].webIDL (for example,
Are there no mochitests for these APIs? I looked in dom/tests/mochitest/ and could not find anything related to audio.
Comment 21•12 years ago
|
||
(In reply to David Dahl :ddahl from comment #20)
> Are there no mochitests for these APIs? I looked in dom/tests/mochitest/ and
> could not find anything related to audio.
content/media/webaudio/test/
Assignee | ||
Comment 22•12 years ago
|
||
(In reply to comment #20)
> > Testing the existing Web IDL implementation will be a _huge_ help! Note
> > that at this stage there are large parts of the Web Audio APIs that we don't
> > implement yet. Unfortunately the best way to tell what has been implemented
> > so far is to look in
> > <http://mxr.mozilla.org/mozilla-central/source/dom/webidl/> for files named
> > like [interfaceName].webIDL (for example,
>
> Are there no mochitests for these APIs? I looked in dom/tests/mochitest/ and
> could not find anything related to audio.
There are some tests in content/media/webaudio/tests, but we don't have an implementation for ScriptPrpcessoprNode yet, which means that we can't write any interesting tests for now (tests that actually see what the audio graph is outputting.) I plan on working on ScriptProcessorNode very soon.
Comment 23•12 years ago
|
||
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #19)
> Testing the existing Web IDL implementation will be a _huge_ help! ...
Ehsan, I am starting to test the IDL implementations. My initial attempt is at https://github.com/automata/webaudio-tests
Currently I am getting: TypeError: context.decodeAudioData is not a function. But looking at AudioContext.webidl, decodeAudioData was implemented. Any suggestions?
BTW maybe this discussion could be more appropriate by IRC/email, so just tell me. I am automata at #media or I can mail you.
> If you're interested in hacking on the implementation itself and have
> experience writing C++ code, please let me know and I would be happy to help
> you find a good place to start! And please ask questions if anything is not
> clear to you. Thanks!
I don't have enough experience writing C++ but I can give a try! Thank you!
Comment 24•12 years ago
|
||
I could get context.decodeAudioData to work with ogg files, while it fails to decode wav audio.
(In reply to Vilson Vieira from comment #23)
> (In reply to :Ehsan Akhgari (needinfo? me!) from comment #19)
> > Testing the existing Web IDL implementation will be a _huge_ help! ...
>
> Ehsan, I am starting to test the IDL implementations. My initial attempt is
> at https://github.com/automata/webaudio-tests
>
> Currently I am getting: TypeError: context.decodeAudioData is not a
> function. But looking at AudioContext.webidl, decodeAudioData was
> implemented. Any suggestions?
>
> BTW maybe this discussion could be more appropriate by IRC/email, so just
> tell me. I am automata at #media or I can mail you.
>
> > If you're interested in hacking on the implementation itself and have
> > experience writing C++ code, please let me know and I would be happy to help
> > you find a good place to start! And please ask questions if anything is not
> > clear to you. Thanks!
>
> I don't have enough experience writing C++ but I can give a try! Thank you!
Comment 25•12 years ago
|
||
boblemarin, if you can give us a testcase (i.e. a page where you can observe the failure to use decodeAudioData on a .wav file), we could fix it faster, I think.
Flags: needinfo?(emeric)
Comment 26•12 years ago
|
||
Ooops. My bad, OGG and WAV decoding are working perfectly.
(test case here : http://minimal.be/mozilla/decode/ )
Flags: needinfo?(emeric)
Comment 27•12 years ago
|
||
Remember to use FirefoxNightly for your tests. The Live channel features a mozAudioContext object that is not functional, but the Nightly channel uses the unprefixed version which has the decodeAudioData method working.
(See my example here: http://minimal.be/mozilla/decode/ )
(In reply to Vilson Vieira from comment #23)
> (In reply to :Ehsan Akhgari (needinfo? me!) from comment #19)
> > Testing the existing Web IDL implementation will be a _huge_ help! ...
>
> Ehsan, I am starting to test the IDL implementations. My initial attempt is
> at https://github.com/automata/webaudio-tests
>
> Currently I am getting: TypeError: context.decodeAudioData is not a
> function. But looking at AudioContext.webidl, decodeAudioData was
> implemented. Any suggestions?
>
> BTW maybe this discussion could be more appropriate by IRC/email, so just
> tell me. I am automata at #media or I can mail you.
>
> > If you're interested in hacking on the implementation itself and have
> > experience writing C++ code, please let me know and I would be happy to help
> > you find a good place to start! And please ask questions if anything is not
> > clear to you. Thanks!
>
> I don't have enough experience writing C++ but I can give a try! Thank you!
Comment 28•12 years ago
|
||
(In reply to boblemarin from comment #26)
> Ooops. My bad, OGG and WAV decoding are working perfectly.
> (test case here : http://minimal.be/mozilla/decode/ )
This causes https://crash-stats.mozilla.com/report/pending/cfed53a0-f354-438e-8788-00b2c2130322 for me after a few presses of the ‘play ogg’ or ‘play wav’
Comment 29•12 years ago
|
||
(In reply to John Drinkwater (:beta) from comment #28)
> (In reply to boblemarin from comment #26)
> > Ooops. My bad, OGG and WAV decoding are working perfectly.
> > (test case here : http://minimal.be/mozilla/decode/ )
>
> This causes
> https://crash-stats.mozilla.com/report/pending/cfed53a0-f354-438e-8788-
> 00b2c2130322 for me after a few presses of the ‘play ogg’ or ‘play wav’
Filed Bug 853434 yesterday already about that one.
Comment 30•12 years ago
|
||
(In reply to XtC4UaLL [:xtc4uall] from comment #29)
> Filed Bug 853434 yesterday already about that one.
ta
Updated•12 years ago
|
Flags: sec-review?
needs fuzzing
Flags: sec-review? → sec-review?(cdiehl)
Assignee | ||
Comment 32•12 years ago
|
||
(In reply to comment #31)
> needs fuzzing
Jesse has been doing some of that. Will definitely need more!
Assignee | ||
Updated•12 years ago
|
Depends on: oscillatornode
Assignee | ||
Comment 33•12 years ago
|
||
It would be great if we could relnote this on Aurora once 23 gets there.
relnote-firefox:
--- → ?
Comment 34•12 years ago
|
||
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #33)
> It would be great if we could relnote this on Aurora once 23 gets there.
Is this coded to be disabled on Beta/Release? Or will the whole feature be ready and enabled in FF23 riding the trains.
Assignee | ||
Comment 35•12 years ago
|
||
(In reply to comment #34)
> (In reply to :Ehsan Akhgari (needinfo? me!) from comment #33)
> > It would be great if we could relnote this on Aurora once 23 gets there.
>
> Is this coded to be disabled on Beta/Release? Or will the whole feature be
> ready and enabled in FF23 riding the trains.
It's not clear yet, we do have a vehicle for disabling it on Beta/Release if needed, and we'll obviously try to ship it as soon as we can. But that's besides the point. What I'm interested in is for this to come up in the list of new things for Aurora 23 so that we can get some developer attention to it.
Updated•12 years ago
|
Comment 36•12 years ago
|
||
This has been noted in the Aurora 23 release notes:
http://www.mozilla.org/en-US/firefox/23.0a2/auroranotes/
If you would like to make any changes or have questions/concerns please contact me directly.
Assignee | ||
Updated•11 years ago
|
Component: Video/Audio → Web Audio
Comment 37•11 years ago
|
||
Hello, I'm getting a sample rate of 48khz in my AudioContext (using the nightly) even if I'm not hooked up to any special audio interfaces. I would expect 44.1... or am I thinking about something wrong? - Charlie
Comment 38•11 years ago
|
||
(In reply to bigbadotis from comment #37)
> Hello, I'm getting a sample rate of 48khz in my AudioContext (using the
> nightly) even if I'm not hooked up to any special audio interfaces. I would
> expect 44.1... or am I thinking about something wrong? - Charlie
Why would you expect 44.1kHz?
The spec does not mandate any particular sample rate. You should always use |AudioContext.sampleRate| to make your calculations anyway, you cannot have guarantees about what the samplerate will be on any particular platform, as it is hardware and OS dependent.
Comment 39•11 years ago
|
||
I'm guessing I'm misunderstanding something fundamental here, but, if my DAC is running 44.1, and Firefox is processing at 48, where is the downsampling occurring? Isn't it a 10% efficiency hit if Firefox is processing more samples per second than my computer is outputting via the DAC?
Thanks for any clarification.
Comment 40•11 years ago
|
||
You are perfectly right, and this is an issue we are going to address in the future, but there is only so many hours in a day.
Comment 41•11 years ago
|
||
Just downloaded the Nightly. No createOscillator() ?
I've been wanting to test this app in FireFox:
http://cloudmusiccompany.appspot.com/
Is there a temporary fix for that to begin testing? Thanks.
Assignee | ||
Comment 42•11 years ago
|
||
(In reply to comment #41)
> Just downloaded the Nightly. No createOscillator() ?
>
> I've been wanting to test this app in FireFox:
>
> http://cloudmusiccompany.appspot.com/
>
> Is there a temporary fix for that to begin testing? Thanks.
Bug 865253 tracks implementing OscillatorNode. We hope to land the fix to that bug within the next few days...
Comment 43•11 years ago
|
||
Any plans to implement createMediaElementSource ?
Assignee | ||
Comment 44•11 years ago
|
||
(In reply to comment #43)
> Any plans to implement createMediaElementSource ?
Of course! See bug 855568.
Updated•11 years ago
|
Updated•11 years ago
|
Target Milestone: --- → mozilla24
Assignee | ||
Updated•11 years ago
|
Summary: Implement Web Audio → Implement and ship Web Audio
Comment 45•11 years ago
|
||
This is currently marked as targeted for Firefox 24. Am I wrong an thinking this should be updated to reflect the new intention to let it bake a bit longer and ship in 25?
Updated•11 years ago
|
QA Contact: manuela.muntean
Updated•11 years ago
|
Assignee | ||
Updated•11 years ago
|
Target Milestone: mozilla24 → mozilla25
Depends on: 904302
Comment 46•11 years ago
|
||
Adding the feature keyword so that this bug is properly picked up by the Release Tracking wiki page.
Keywords: feature
Comment 47•11 years ago
|
||
Is everything on track to leave this on in Firefox 25 and have it pulled into Firefox 1.2? The last answer was yes, but I wanted to confirm before Monday.
Comment 49•11 years ago
|
||
It's going to be close, but I still intend to close by blocker before Monday.
Flags: needinfo?(giles)
Comment 50•11 years ago
|
||
Did we make it?
Assignee | ||
Comment 51•11 years ago
|
||
(In reply to comment #50)
> Did we make it?
Yeah, we'll try to uplift the patches that missed the deadline.
Comment 52•11 years ago
|
||
Ok great, drop in a comment once the last blocker is confirmed as in both Firefox 25 Desktop and Android along with Firefox 1.2. If either of those release versions changes, please let me know asap.
Assignee | ||
Comment 53•11 years ago
|
||
Let's call this fixed.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Comment 54•11 years ago
|
||
In case anyone wants to do some performance tests, my app here is updated to work with FireFox's Web Audio API support (trying to keep consistent with iOS 6's Web Audio API in Safari Mobile and FireFox needs basically two interfaces).
http://cloudmusiccompany.appspot.com/
Updated•11 years ago
|
Blocks: gecko-games
Comment 55•11 years ago
|
||
I've been testing WebAudio API on firefox 27 (beta as of today) with audio tag as source [createMediaElementSource(audio_tag)], and after doing that binding, setting the audio_tag.playbackrate during audio execution makes no effect anymore... also, timeudate event is not fired, and the audio tag cursor on the controls stops indicating the current time.
Hope this report helps.
Comment 56•11 years ago
|
||
(In reply to Sergio from comment #55)
> I've been testing WebAudio API on firefox 27 (beta as of today) with audio
> tag as source [createMediaElementSource(audio_tag)], and after doing that
> binding, setting the audio_tag.playbackrate during audio execution makes no
> effect anymore... also, timeudate event is not fired, and the audio tag
> cursor on the controls stops indicating the current time.
>
> Hope this report helps.
I think this (apart from the playback rate thing) has been fixed in current Nightly.
Comment 57•11 years ago
|
||
(In reply to Paul Adenot (:padenot) from comment #56)
> I think this (apart from the playback rate thing) has been fixed in current
> Nightly.
It sounds like Sergio is reporting more than one bug here.
Paul -- Is there a bug already tracking some of this? If so, do you have the bug number? And is there a fix available that should be uplifted (at least to Fx 28)? Does the playback rate problem (that you think may not be fixed) also have a bug number, and is it a Web Audio bug or Video/Audio (Media Playback) bug? Thanks.
Flags: needinfo?(paul)
Comment 58•11 years ago
|
||
(In reply to Maire Reavy [:mreavy] from comment #57)
> (In reply to Paul Adenot (:padenot) from comment #56)
>
> > I think this (apart from the playback rate thing) has been fixed in current
> > Nightly.
>
> It sounds like Sergio is reporting more than one bug here.
>
> Paul -- Is there a bug already tracking some of this? If so, do you have
> the bug number? And is there a fix available that should be uplifted (at
> least to Fx 28)? Does the playback rate problem (that you think may not be
> fixed) also have a bug number, and is it a Web Audio bug or Video/Audio
> (Media Playback) bug? Thanks.
That would mean uplifting roc's changes in 938022, if not more.
The playbackRate bug is a bug at the barrier between Media Playback and Web Audio. I opened bug 966247 to track this.
Flags: needinfo?(paul)
Comment 59•11 years ago
|
||
(In reply to Paul Adenot (:padenot) from comment #58)
> That would mean uplifting roc's changes in 938022, if not more.
Thanks for the bug number. The good news is that that fix is already in Fx 28.
>
> The playbackRate bug is a bug at the barrier between Media Playback and Web
> Audio. I opened bug 966247 to track this.
Thanks!
Updated•11 years ago
|
Flags: sec-review?(cdiehl) → sec-review+
You need to log in
before you can comment on or make changes to this bug.
Description
•