W3C home > Mailing lists > Public > public-audio@w3.org > October to December 2012

Re: Wrapper for combination of nodes

From: Chris Lowis <chris.lowis@bbc.co.uk>
Date: Tue, 18 Dec 2012 11:10:06 +0000
To: Stuart Memo <stuartmemo@gmail.com>
CC: <public-audio@w3.org>
Message-ID: <m0hanj7h0x.fsf@rd00051.national.core.bbc.co.uk>

> I'm struggling to find a decent solution to packaging a group of nodes
> together in a way that can be used similarly to native nodes. For example,
> the recent Jam with Chrome article on html5rocks does this :
>
> var MyCustomNode = function(){
>     this.input = audioContext.createGainNode();
>     var output = audioContext.createGainNode();
>
>     this.connect = function(target){
>        output.connect(target);
>     };
> };

Hi Stuart!

Could you return output from your MyCustomNode function?

  var MyCustomNode = function(){
      this.input = audioContext.createGainNode();
      var output = audioContext.createGainNode();

      this.connect = function(target){
         output.connect(target);
      };

      return output;
  };

I think this would let you do:

 gain.connect(customNode);

If I understand correctly what you mean.

Cheers,

Chris

http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					
Received on Tuesday, 18 December 2012 11:10:33 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:50:04 UTC