HTML5麦克风捕获在Firefox中停止5秒后停止。它在Chrome中运行良好。我从Github那里获取了这段代码。
var audio_context;
var recorder;
var localStream; // line added by me
function startUserMedia(stream) {
localStream = stream; // line added by me
var input = audio_context.createMediaStreamSource(stream);
答案 0 :(得分:1)
var audio_context;
var recorder;
function startUserMedia(stream) {
var input = audio_context.createMediaStreamSource(stream);
将上述行更改为:
var audio_context;
var recorder;
var localStream; // line added by me
function startUserMedia(stream) {
localStream = stream; // line added by me
var input = audio_context.createMediaStreamSource(stream);