Skip to content

ScriptProcessor node does not work if output is not connected #345

@zzmp

Description

@zzmp

I've found this issue in the Chromium bugs, but couldn't find a reference to it here.

I'm not sure if this is the official bug list for Web Audio and/or the specification, but it would be valuable to be able to act on the data from a ScriptProcessorNode without needing to pipe it to a destination node, and I did not see the issue on this list yet.

Currently, setting the numberOfOutputChannels to 0 when creating the node and not connecting it to a destination causes it to not raise events or pipe audio:

var context = new AudioContext();
var processor = context.createScriptProcessor(4096, 1, 0);
var source;

// event is never raised
processor.onaudioprocess = function(e) {
  console.log('Processing audio');
};

navigator.webkitGetUserMedia({audio: true},
  function(stream) {
    source = context.createMediaStreamSource(stream);
    source.connect(processor);
    // only functions with code below, when processor is created as: createScriptProcessor(4096, 1, 1)
    // processor.connect(context.destination);
  },  
  function() {
    console.error('Failed to instantiate audio stream.');
  }
);

Does anyone know if this is planned for the future, or already known?


I'm working in Chrome 36.0.1985.125 (Official Build 283153) on a Mac OS X

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions