admin管理员组文章数量:1401666
I'm looking to get the microphone activity level of a WebRTC MediaStream. However, I need to get this information without playing back the microphone to the user (otherwise there will be the loopback effect).
The answer in Microphone activity level of WebRTC MediaStream relies on the audio being played back to the user. How can I do this, without playing back the microphone?
I'm looking to get the microphone activity level of a WebRTC MediaStream. However, I need to get this information without playing back the microphone to the user (otherwise there will be the loopback effect).
The answer in Microphone activity level of WebRTC MediaStream relies on the audio being played back to the user. How can I do this, without playing back the microphone?
Share Improve this question asked Jul 8, 2014 at 6:25 apscienceapscience 7,28311 gold badges57 silver badges89 bronze badges 1- No it does not? I just tested the code and the mediastream simply goes into the node and is never played back to the speakers. I believe you HAVE to do with with the AudioAPI and connecting it to a node is not playing the audio back... – Benjamin Trent Commented Jul 8, 2014 at 13:05
1 Answer
Reset to default 7Take a look at createGain
method. It allows you to set stream's volume.
Here is my (simplified) example that I use in my project:
navigator.getUserMedia({audio: true, video: true}, function(stream) {
var audioContext = new AudioContext; //or webkitAudioContext
var source = audioContext.createMediaStreamSource(stream);
var volume = audioContext.createGain();
source.connect(volume);
volume.connect(audioContext.destination);
volume.gain.value = 0; //turn off the speakers
//further manipulations with source
}, function(err) {
console.log('error', err);
});
本文标签: javascriptWebRTC Get audio level of a mediaStream *without* playing back the audioStack Overflow
版权声明:本文标题:javascript - WebRTC: Get audio level of a mediaStream *without* playing back the audio - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744317640a2600341.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论