Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use microphone and sound with javascript?

Tags:

javascript

I would like to develop a very small application using javascript... this application should pass the voice recorded from a microphone to the sound.

Is it possible?

I know that i can access to microphone using Flash, but i would like to use javascript if possible.

Thank you!

like image 970
Dail Avatar asked Jun 04 '11 13:06

Dail


People also ask

How do I access my microphone in HTML?

Using the getUserMedia() API, you can capture raw audio input from your microphone.

How can I use my mic as a sound?

Open the setting of one your microphone devices and enable "Listen to device", select your current output device from the list. Playback audio on that same output device. The mic signal equals the output signal.


2 Answers

Keep an eye on HTML5's implementation of getUserMedia. For a work-around using flash see:

https://code.google.com/p/wami-recorder/

That example actually passes audio to a server via an HTTP post (so no need for a Flash Media Server), but you could easily adapt it to keep the audio on the client side.

like image 79
Ian McGraw Avatar answered Sep 23 '22 22:09

Ian McGraw


In this question about video streaming via web sockets it is possible to stream video. Theoretically it might be possible to write a client side application that creates a local TCP socket for microphone and audio, to which the browser and Javascript then listen.

I don't know if this has ever been attempted, and it would require significant code outside the browser to make happen.

You don't gain much either by doing it this way, over say, Flash since you still have client-side dependencies.

like image 37
Michael Berkowski Avatar answered Sep 24 '22 22:09

Michael Berkowski