Can I use javascript to record voice on a web app? Can I use javascript to record voice on a web app? javascript javascript

Can I use javascript to record voice on a web app?


It can be done but the solution won't work across all platforms at the moment.

<input type="file" accept="audio/*;capture=microphone">

See HTML5 Media Capture

Currently Supported By:

Android 3.0 browser, Chrome for Android (0.16), Firefox Mobile 10.0, iOS6 Safari and Chrome (partial support)

Links:

http://www.html5rocks.com/en/tutorials/getusermedia/intro/

Audio capturing with HTML5


Javascript cannot access your hardware directly. What you need, is a client side technology that can. Flash, for one.

Javascript can communicate quite easily with flash, so you can hide your flash recorder and construct your recorder ui with html/js/css.

Here's one example: https://github.com/jwagener/recorder.js/blob/master/examples/example-1.html

Here's another one:http://blogupstairs.com/flashwavrecorder-javascript-flash-audio-recorder/

I realize this is not EXACTLY what you need, but you didn't tell why you want a JS solution. This doesn't fix the flash dependency problem but it solves the UI problem since you can construct the UI without flash.


Another wellknow solution is WAMI, I know it's not pure javascript but maybe it can help.

"As of this writing, most browsers still do not support WebRTC's getUserMedia(), which promises to give web developers microphone access via Javascript. This project achieves the next best thing for browsers that support Flash. Using the WAMI recorder, you can collect audio on your server without installing any proprietary media server software."https://code.google.com/p/wami-recorder/

Another example using node.js This example application is written in JavaScript and uses Node and Express for the web server and framework. You will need all three installed on your web server in order for this to work, as well as the Node.js WebAPI Library.nodejs voice recording example