This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17493 - JSAudioNode should be an EventTarget
Summary: JSAudioNode should be an EventTarget
Status: CLOSED FIXED
Alias: None
Product: AudioWG
Classification: Unclassified
Component: Web Audio API (show other bugs)
Version: unspecified
Hardware: PC Windows 3.1
: P2 normal
Target Milestone: TBD
Assignee: Chris Rogers
QA Contact: public-audio
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-15 01:04 UTC by Dean Jackson
Modified: 2013-03-13 15:32 UTC (History)
4 users (show)

See Also:


Attachments

Description Dean Jackson 2012-06-15 01:04:12 UTC
Currently, the spec says this:

https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#JavaScriptAudioNode-section

interface JavaScriptAudioNode : AudioNode {
  attribute EventListener onaudioprocess;

  readonly attribute long bufferSize;
}

An "onaudioprocess" property? This is not the right way to expose this.

Instead, JavaScriptAudioNode should implement EventTarget, and thus get addEventListener, removeEventListener, etc. I'd prefer it if it removed the property, but I guess there is now some legacy content and there are some misguided developers who think that approach is acceptable.

Then there should be a "audioprocess" event (or something like that).
Comment 1 Chris Rogers 2012-06-15 03:39:31 UTC
I'd like to move away from EventListener here and change to a simpler Callback.  It doesn't really make much sense to have multiple listeners since the processing should happen in a single place.
Comment 2 Marcus Geelnard (Opera) 2012-06-15 13:11:50 UTC
I guess this is a duplicate of Bug 17351 - right?
Comment 3 Philip Jägenstedt 2012-07-24 12:31:16 UTC
Well, Bug 17351 would be invalid if we go with a callback instead, which I agree we should do, for the reasons Chris mentions.
Comment 4 Dominic Cooney 2013-02-19 05:13:22 UTC
I believe that this is fixed; ScriptProcessorNode (the new name of JavaScriptAudioNode) no longer has anything to do with EventTarget (good!)

The interfaces are now [1]

interface ScriptProcessorNode : AudioNode {

    attribute EventListener onaudioprocess;

    readonly attribute long bufferSize;

};

interface AudioNode {
    …
};

[1] <https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#ScriptProcessorNode>

There is a separate bug 20764 for using a proper callback instead of EventListener for onaudioprocess.
Comment 5 Olivier Thereaux 2013-03-13 15:32:09 UTC
(In reply to comment #4)
> I believe that this is fixed
[...] 
> There is a separate bug 20764 for using a proper callback instead of
> EventListener for onaudioprocess.

Seeing no objection in almost a month, closing.