Audio recording with HTML5

▼魔方 西西 提交于 2019-12-09 22:55:26

问题


I'm trying to implement audio recording in a website. Basically the user should be able to press a button and speak something into the microphone. The recorded audio should then be sent to the server for further processing. I realise that you can do this with Flash, but for now I'm trying to avoid that.

I found several resources on the internet about it (i.e. link) but as it seems, this functionality is not widly supported yet. I experienced differences betweet the used browser and between the used operating system. For instance, the Chrome Browser doesn't seem to access any microphone on Linux correctly. So i was wondering if anyone knows a good resource to dive into this. Or maybe someone tried to set up something like this himself, and can help with some suggestions about where the limitations of HTML5 and the JavaScript Web Audio API are right now.

Thanks!


回答1:


As of Chrome Version 27.0.1453.56 beta Mac, audio recording works with this demo application https://github.com/mattdiamond/Recorderjs

This app returns back a WAV file for the user which can be uploaded to the server.

If you want a truly robust solution that works on most desktop web browsers, you may need to resort to Flash.




回答2:


This article covers up pretty well the current state of audio video capture possibilites using HTML5:

http://hdfvr.com/html5-video-recording

Also for just audio capture, here's a gitHub project that records audio to mp3 directly from the browser:

https://github.com/nusofthq/Recordmp3js



来源:https://stackoverflow.com/questions/16761496/audio-recording-with-html5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!