2

根据这篇文章,以下代码应该可以在 OSX 和 Windows 上运行,但没有提到 Linux:

http://updates.html5rocks.com/2012/09/Live-Web-Audio-Input-Enabled

// success callback when requesting audio input stream
function gotStream(stream) {
    var audioContext = new webkitAudioContext();

    // Create an AudioNode from the stream.
    var mediaStreamSource = audioContext.createMediaStreamSource( stream );

    // Connect it to the destination to hear yourself (or any other node for processing!)
    mediaStreamSource.connect( audioContext.destination );
}

navigator.webkitGetUserMedia( {audio:true}, gotStream );

我下载了 Chrome Dev 版本:版本 25.0.1323.1 dev 并且它不工作。

我启用了以下标志:

Web Audio Input Mac, Windows, Linux, Chrome OS
Enables live audio input using getUserMedia() and the Web Audio API.
4

3 回答 3

1

从 chrome 版本 24.0.1312.69 和 Dartium 版本 26.0.1403.0(铬衍生物)开始,我无法在 Ubuntu 12.10 上使用 Live Input从http://webaudiodemos.appspot.com/制作任何演示。我启用了正确的 chrome://flags。

对我来说,它在 MacOS 上运行良好,但在使用麦克风或 USB 摄像头的 Ubuntu 上却失败了。Ubuntu Sound Recorder 工作正常,所以我知道我的硬件工作正常。

很高兴知道它是否应该在 Linux 上运行,或者何时计划得到官方支持。

于 2013-02-18T21:37:29.753 回答
1

我也可以验证这一点。在官方 Chromium 错误跟踪器上创建票证:

http://code.google.com/p/chromium/issues/detail?id=177862

于 2013-02-25T23:52:00.910 回答
1

在https://src.chromium.org/viewvc/chrome?revision=192893&view=revision中添加了 Linux 对实时音频的支持。

目前适用于 Google Chrome 版本 28.0.1500.89 测试版。在 Arch Linux 上测试。

于 2013-07-15T20:23:51.687 回答