How to use the standardized-audio-context.ChannelMergerNode function in standardized-audio-context

To help you get started, we’ve selected a few standardized-audio-context examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vitaliy-bobrov / js-rocks / src / app / audio / effects / reverb.ts View on Github external
constructor(
    context: AudioContext,
    model: string,
    buffer$: Observable,
    convolverMakeUp: number,
    protected defaults: ReverbSettings
  ) {
    super(context, model);

    this.splitter = new ChannelSplitterNode(context);
    this.timeNode = new DelayNode(context);
    this.toneNode = new StandardTone(context);
    this.convolver = new ConvolverNode(context);
    this.wet = new GainNode(context);
    this.dry = new GainNode(context);
    this.merger = new ChannelMergerNode(context);
    this.makeUpGain = new GainNode(context);

    this.processor = [
      this.splitter,
      this.timeNode,
      ...this.toneNode.nodes,
      this.convolver,
      this.wet,
      this.merger,
      this.makeUpGain
    ];

    connectNodes(this.processor);
    this.splitter.connect(this.dry).connect(this.merger, 0, 1);

    this.applyDefaults();
github vitaliy-bobrov / js-rocks / src / app / audio / effects / tone.ts View on Github external
constructor(context: AudioContext, range: [number, number] = [550, 1000]) {
    this.splitter = new ChannelSplitterNode(context);

    this.lowpassFilter = new IIRFilterNode(context, {
      ...onePoleLowpass(range[0], context.sampleRate)
    });

    this.toneLowGain = new GainNode(context);

    this.highpassFilter = new IIRFilterNode(context, {
      ...onePoleHighpass(range[1], context.sampleRate)
    });

    this.toneHighGain = new GainNode(context);
    this.merger = new ChannelMergerNode(context);

    this.splitter
      .connect(this.highpassFilter)
      .connect(this.toneHighGain)
      .connect(this.merger, 0, 1);
  }