Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return destination from AudioNode::connect() #258

Closed
chrislo opened this issue Oct 17, 2013 · 1 comment
Closed

Return destination from AudioNode::connect() #258

chrislo opened this issue Oct 17, 2013 · 1 comment

Comments

@chrislo
Copy link
Member

chrislo commented Oct 17, 2013

The following issue was raised by the W3C TAG as part of their review of the Web Audio API

Why doesn't AudioNode::connect() return the passed AudioNode destination? It would enable a much terser chained style in some cases. Janessa Det provides the example of:

  oneShotSound.connect(lowpass);
  lowpass.connect(panner);
  panner.connect(gainNode2);
  gainNode2.connect(compressor);
  compressor.connect(destination);

becoming:

  oneShotSound
      .connect(lowpass)
      .connect(panner)
      .connect(gainNode2)
      .connect(compressor)
      .connect(destination);
@juliangruber
Copy link

+1 this helps clean up code a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants