【发布时间】:2021-08-28 20:46:03
【问题描述】:
我正在尝试从麦克风接收音频并将其通过一些过滤器并从中再次创建一个流并将其发送到扬声器,以便我可以收听处理后的音频。 但是当我将新流传递到目的地时,我听不到任何音频。
const [stream] = await Promise.all([
navigator.mediaDevices.getUserMedia({
audio: {
deviceId: { exact: input.value },
channelCount: { ideal: 1 },
noiseSuppression: { ideal: false },
echoCancellation: { ideal: true },
autoGainControl: { ideal: false },
sampleRate: { ideal: 48000 },
},
}),
]);
const source = context.createMediaStreamSource(stream);
//filters will be added later
//source.connect(context.destination) this works i can hear the audio
const newStream = context.createMediaStreamDestination().stream;
//I need to convert the filtered audio back to stream
const source2 = context.createMediaStreamSource(newStream);
source2.connect(context.destination); //this doesnt work i cant hear audio
【问题讨论】: