0

我正在尝试操纵 OfflineAudioText 中各个缓冲区的增益。

交流和数据加载后预先确定

 var source = ac.createBufferSource();
 source.buffer = data;
 var splitter = ac.createChannelSplitter(2);
 source.connect(splitter);
 var merger = ac.createChannelMerger(2);

 var gainNode = ac.createGain();
 gainNode.gain.value = 0.5;

 splitter.connect(gainNode, 0);
 splitter.connect(gainNode, 1);
 gainNode.connect(merger, 0, 1);
//error occurs here
 gainNode.connect(merger, 1, 0);

 var dest = ac.createMediaStreamDestination();
 merger.connect(dest);

错误:无法在“AudioNode”上执行“连接”:输出索引 (1) 超过输出数 (1)

4

1 回答 1

0

我没有正确分配输入:

splitter.connect(gainNode, 0); splitter.connect(gainNode, 1);

gainNode.connect(合并, 0, 0); gainNode.connect(合并, 0, 1);

于 2018-01-31T21:36:05.150 回答