本文介绍了录制音频流从getUserMedia的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在最近几天,我试图用JavaScript来录制音频流。
我发现没有例如code这工作的。

有没有浏览器支持?

下面是我的code

  navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia ||
                         navigator.mozGetUserMedia || navigator.msGetUserMedia;navigator.getUserMedia({音频:真正},gotStream,NULL);
功能gotStream(流){        msgStream =流;
        msgStreamRecorder = stream.record(); //没有方法记录:(
}


解决方案

您可以检查这个网站:

有存储音频到客户侧的文件(.wav)。

In recent days, I tried to use javascript to record audio stream.I found that there is no example code which works.

Is there any browser supporting?

Here is my code

navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia ||
                         navigator.mozGetUserMedia || navigator.msGetUserMedia;

navigator.getUserMedia({ audio: true }, gotStream, null);
function gotStream(stream) {

        msgStream = stream;
        msgStreamRecorder = stream.record(); // no method record :(
}
解决方案

You could check this site:http://www.webaudiodemos.appspot.com/AudioRecorder/

It stores the audio into a file (.wav) on the client side.

这篇关于录制音频流从getUserMedia的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 14:50