WebRTC和Google Chrome应用程序-麦克风音量调节 [英] WebRTC and Google Chrome App - microphone volume adjustment

查看:212
本文介绍了WebRTC和Google Chrome应用程序-麦克风音量调节的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Chrome应用中调整麦克风的音量.有可能做到吗?我正在使用webrtc.

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

推荐答案

可能

  • 使用WebAudio和增益过滤器调整音量
  • 设置音频/视频标签的音量(在接收端)

这是第一个选项的一些示例代码

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);

,然后使用audioContext.createMediaStreamDestination().stream. yourStream是您从getUserMedia()获得的原始流.

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

这篇关于WebRTC和Google Chrome应用程序-麦克风音量调节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆