HTML5:在 Ubuntu 上从麦克风播放扬声器流 [英] HTML5: play on speakers stream from microphone on Ubuntu
问题描述
我正在学习 html5,想尝试在扬声器上播放我在麦克风上说的话.于是我写了下面的js代码:
I am learning html5 and want to try to play on speakers what I say on microphone. So I wrote the following js code:
navigator.getUserMedia = navigator.getUserMedia ||navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
var aCtx;
var analyser;
var microphone;
if (navigator.getUserMedia) {
navigator.getUserMedia(
{audio: true},
function(stream) {
aCtx = new AudioContext();
analyser = aCtx.createAnalyser();
microphone = aCtx.createMediaStreamSource(stream);
microphone.connect(analyser);
var destination=aCtx.destination;
analyser.connect(destination);
},
function(){ console.log("Error 003.")}
);
}
我在 firefox 47 和 ubuntu 14 上进行了测试.我看到面板可以共享我的麦克风,我选择了共享,但我什么也没听到.如何解决?
I test it on firefox 47 and ubuntu 14. I see the panel to share my microphone, I select share and nothing I hear nothing. How to fix it?
但是,它适用于 windows7 中的 Firefox 47.但是在 ubuntu 中,我安装了所有驱动程序,并且我使用 Skype、youtube 等,除了这个 js 脚本外,一切正常.
However, it works on firefox 47 in windows7. But in ubuntu I have all drivers installed and I use skype, youtube etc everything works except this js script.
推荐答案
我发现了问题.有一些附加
设置:CubebUtils
I found out the problem. There are some additional
settings:CubebUtils
这篇关于HTML5:在 Ubuntu 上从麦克风播放扬声器流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!