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 17793 - AudioNode.disconnect() needs to be able to disconnect only one connection
Summary: AudioNode.disconnect() needs to be able to disconnect only one connection
Status: CLOSED WONTFIX
Alias: None
Product: AudioWG
Classification: Unclassified
Component: Web Audio API (show other bugs)
Version: unspecified
Hardware: All Windows 3.1
: P2 normal
Target Milestone: TBD
Assignee: Chris Rogers
QA Contact: public-audio
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-17 18:30 UTC by Chris Wilson
Modified: 2014-10-28 17:16 UTC (History)
2 users (show)

See Also:


Attachments

Description Chris Wilson 2012-07-17 18:30:24 UTC
(Summary of email conversation in list)

There is currently no way to disconnect node A's connection to node B without disconnecting all connections from node A to other nodes.  This makes it impossible to disconnect node B from the graph without potential side effects, as you have to:

- call disconnect() on node A (which disconnects all its outputs)
- reconnect every connection that node A used to have, EXCEPT the connection to node B.

Not only is this cumbersome, it will be problematic in the future when we solve the related issue of unconnected streams - which is currently exhibiting incorrect behavior in Chrome (it pauses the audio stream), but is underspecified in the spec today.  (filing separate bug).  Disconnecting then reconnecting would have to have no side effects.  (It works okay today, but not ideal - can click.)

Recommended solution:
- there should be a way to remove a single connection (by supplying the destination node to be disconnected, since there can only be one connection to a given destination node [tested]).

E.g.: the IDL for disconnect should read:

        void disconnect(in [Optional] AudioNode destination, in [Optional] unsigned long output = 0)
            raises(DOMException);

this lets us keep most compatibility - node.disconnect() will still remove all connections.
Comment 1 Chris Rogers 2012-07-30 20:16:50 UTC
(In reply to comment #0)
> (Summary of email conversation in list)
> 
> There is currently no way to disconnect node A's connection to node B without
> disconnecting all connections from node A to other nodes.  This makes it
> impossible to disconnect node B from the graph without potential side effects,
> as you have to:
> 
> - call disconnect() on node A (which disconnects all its outputs)
> - reconnect every connection that node A used to have, EXCEPT the connection to
> node B.
> 
> Not only is this cumbersome, it will be problematic in the future when we solve
> the related issue of unconnected streams - which is currently exhibiting
> incorrect behavior in Chrome (it pauses the audio stream), but is
> underspecified in the spec today.  (filing separate bug).  Disconnecting then
> reconnecting would have to have no side effects.  (It works okay today, but not
> ideal - can click.)
> 
> Recommended solution:
> - there should be a way to remove a single connection (by supplying the
> destination node to be disconnected, since there can only be one connection to
> a given destination node [tested]).
> 
> E.g.: the IDL for disconnect should read:
> 
>         void disconnect(in [Optional] AudioNode destination, in [Optional]
> unsigned long output = 0)
>             raises(DOMException);
> 
> this lets us keep most compatibility - node.disconnect() will still remove all
> connections.

I agree we need to extend disconnect() with more optional parameters to allow disconnecting specific connections.

I think we'll also need to add an "input" parameter similar to the connect() method to be able to say *which* specific input to disconnect:

void disconnect(in AudioNode destination, in [Optional] unsigned long output = 0, in [Optional] unsigned long input = 0)
            raises(DOMException);

This would make the API look the same as connect(), and allow disconnecting an exact connection.
Comment 2 Olivier Thereaux 2014-10-28 17:13:28 UTC
Web Audio API issues have been migrated to Github. 
See https://github.com/WebAudio/web-audio-api/issues
Comment 3 Olivier Thereaux 2014-10-28 17:16:26 UTC
Closing. See https://github.com/WebAudio/web-audio-api/issues for up to date list of issues for the Web Audio API.