HTML5:在 Ubuntu 上从麦克风播放扬声器流 [英] HTML5: play on speakers stream from microphone on Ubuntu

查看:41
本文介绍了HTML5:在 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屋!

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