Javascript 网络音频-更改现场话筒的音高
我使用此代码在麦克风和扬声器之间建立实时连接。有可能实时改变我的音调吗Javascript 网络音频-更改现场话筒的音高,javascript,html,web-audio-api,Javascript,Html,Web Audio Api,我使用此代码在麦克风和扬声器之间建立实时连接。有可能实时改变我的音调吗 navigator.getUserMedia( { audio: true }, function(stream) { window.AudioContext = window.AudioContext || window.webkitAudioContext; var ctx= new AudioContext(); // Create an AudioNode from the st
navigator.getUserMedia(
{ audio: true },
function(stream) {
window.AudioContext = window.AudioContext || window.webkitAudioContext;
var ctx= new AudioContext();
// Create an AudioNode from the stream.
var mediaStreamSource = ctx.createMediaStreamSource( stream );
// Connect it to the destination to hear yourself (or any other node for processing!)
mediaStreamSource.connect( ctx.destination );
},
function(err) {
console.log(err);
}
);
我认为WebAudio中没有任何方法可以改变音调,除非您自己在ScriptProcessorNode或即将推出的AudioWorkerNode中实现它。事实上,这是可能的。我在InputEffects演示(,select“Pitch Shifter”)中使用了粒度再合成方法,使用了一对具有循环斜坡延迟时间的延迟节点。如果你想做一些更有趣的事情(比如,相移声码),你可能需要一个脚本处理器/音频工作者。完全是克里斯·罗杰斯的代码——尽管我确实想出了一个聪明的方法来动态控制音调延迟。:)