我有这段代码可以在我的麦克风和扬声器之间建立实时连接。是否可以实时改变我的音调?
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);
}
);
最佳答案
事实上,这是可能的。我在输入效果演示( https://webaudiodemos.appspot.com/input/index.html ,选择“音调更改器(mutator)”)中使用粒度再合成方法,使用一对具有循环斜坡延迟时间的延迟节点来完成此操作。如果您想做一些更奇特的事情(例如相移声码),您可能需要一个 ScriptProcessor/AudioWorker。
关于javascript - 网络音频 - 更改现场麦克风的音调,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34324042/