Html 使用 HTML5 进行音频捕获
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4227313/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Audio capturing with HTML5
提问by Asaf
I've tried to see if there's a way to record audio with HTML5 to no avail. I tried using this example but it didn't work. I'm guessing he really meant it when he said that it is not supported by any browser yet.
我试图看看是否有办法用 HTML5 录制音频无济于事。我尝试使用此示例,但没有用。我猜当他说任何浏览器都不支持它时,他是认真的。
Am I missing something? perhaps it is already possible? What are my options to record audio on a browser-based application?
我错过了什么吗?也许已经有可能了?在基于浏览器的应用程序上录制音频有哪些选项?
Open Source only please :)
请只开放源代码:)
采纳答案by Wouter Dorgelo
You might wanna have a look at HTML Media Captureand its API.
Ericsson labs already achieved this, see: here(Note: Note that the device element and the related APIs are not available in any browser yet, and the APIs may change before this happens.) But it gives you a rough idea about how it's done.
爱立信实验室已经实现了这一点,请参见:此处(注意:请注意,设备元素和相关 API 在任何浏览器中尚不可用,并且 API 可能会在此发生之前发生变化。)但它让您大致了解它是如何完成的.
I am currently working on something like this myself, see: here.
我目前正在自己做这样的事情,请参阅:here。
回答by Warren Wang
This is the only solution within iOS 6 that I've found so far:
这是迄今为止我在 iOS 6 中找到的唯一解决方案:
Youtube video showing how it works
The source can be found here: GitHub Repository Link
来源可以在这里找到: GitHub Repository Link
It uses an workaround by using iOS6's camera plugin's record features to record video and audio and uploads that to the server. Then FFMPEG crunches the video and extracts the audio as a .wav file.
它使用了一种变通方法,即使用 iOS6 的相机插件的录制功能来录制视频和音频并将其上传到服务器。然后 FFMPEG 处理视频并将音频提取为 .wav 文件。
With all the limitations and unfinalized HTML 5 specs, I think this is the only way for it to work. I hope this helps.
考虑到所有限制和未完成的 HTML 5 规范,我认为这是它工作的唯一方法。我希望这有帮助。