Can anyone suggest how to record audio from microphone on a website using html5 and javascript

北战南征 提交于 2019-12-18 16:10:33

问题


I want to record audio using javascript and html5, there is device element in html5 but i dont know to use it. Found no examples for the same.


回答1:


No current stable browser supports the Stream API (formally known as <device>), so in practical terms — you can't. The lack of examples using it is a consequence of this.

If you want to play with it, you have to use development branches of Chrome. There is a demo of voice input here.




回答2:


currently, there are three ways to do it

  1. as wav
    all code client-side, uncompressed recording], you can check out --> http://github.com/mattdiamond/Recorderjs
  2. as mp3 [ all code client-side, compressed recording], you can check out --> http://github.com/Mido22/mp3Recorder
  3. as opus packets [ client+ server(node.js) code, compressed recording], you can check out --> http://github.com/Mido22/recordOpus



回答3:


A quick search returned https://labs.ericsson.com/developer-community/blog/beyond-html5-audio-capture-web-browsers, which contains the device element you mentioned.



来源:https://stackoverflow.com/questions/6058242/can-anyone-suggest-how-to-record-audio-from-microphone-on-a-website-using-html5

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