根据本文,以下代码应可在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 );
我下载了版本为25.0.1323.1 dev的Chrome Dev,它无法正常工作。
我启用了以下标志:
Web Audio Input Mac, Windows, Linux, Chrome OS
Enables live audio input using getUserMedia() and the Web Audio API.
最佳答案
在https://src.chromium.org/viewvc/chrome?revision=192893&view=revision中添加了对实时音频的Linux支持。
目前适用于Google Chrome 28.0.1500.89 beta版。在Arch Linux上测试。