WebRTC and Google Chrome App - microphone volume a

2019-09-11 11:05发布

I'm trying to adjust microphone volume in Chrome App. Is is possible to do it? I'm using webrtc.

1条回答
我只想做你的唯一
2楼-- · 2019-09-11 11:05

It's possible

  • to use WebAudio and a gain filter to adjust the volume
  • to set the volume of an audio/video tag (on the receiving end)

Here is some sample code for the first option

var audioContext = new AudioContext();
var sourceStream = audioContext.createMediaStreamSource(yourStream);
var gain = audioContext.createGain();
sourceStream.connect(gain);
gain.value = 0.9;
gain.connect(audioContext.destination);

and then use audioContext.createMediaStreamDestination().stream. yourStream is the original stream that you got from getUserMedia().

查看更多
登录 后发表回答