Can I use microphone and sound with javascript? - 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!

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.

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.

Nope. This is not possible. Javascript is not meant to access devices. you will need some abstraction technology like flash or silverlight that can help you with this otherwise javascript engine runs under the browser and it has no strings attached to the client-machine on which the browser is running.

Related

How to play MP3 files into the microphone input jQuery

I am attempting to create it so when a user plays a sound, it plays the sound to the users microphone input. Thus when they're in a Skype Call/Game chat/etc it will be played for all users to hear.
Is there any way to play music to the microphone instead of speakers in Javascript/jQuery? If not, does node-webkit give me any more ability to do this?
Hopefully this is well explained, it is a little challenge.
Thanks for any, and all advise!
This is not possible from the web browser alone. Most systems aren't even capable of this directly.
It is up to the client to decide how to route audio and there is no control of this within the browser, except for what happens within the page itself.
The best you can do is to recommend to your users how to configure their systems. For your Windows users, they will need a virtual audio loopback driver. http://vb-audio.pagesperso-orange.fr/Cable/

Streaming/playing the video from the user's filesystem

The user has a video file on his system. Now, on the webpage there is an option to select a video file from his computer itself. I am seeking a way to directly stream the video on a html5 video tag(or any other player for that matter) from his/her computer on the fly. Please help.
This is a bad question and I do not see any effort from your part. Please check how to pose a question: https://stackoverflow.com/help/how-to-ask
Assuming you only need to support Web Browsers that support HTML5 then try
WebRTC (http://www.webrtc.org/home)
WebRTC is a free, open project that enables web browsers with
Real-Time Communications (RTC) capabilities via simple JavaScript
APIs. The WebRTC components have been optimized to best serve this
purpose.
It is important to note that this is just my personal preference.
Edit:
If you want to steam a file then take a look at VideoLAN (or VideoLAN Server). http://www.videolan.org/index.html

What Protocol to use for chat? webRTC or Websockets

I'm creating a Chat site that will be able to do, Video, Audio and Text Chatting. I'm currently using Websockets for Text Chatting. I need to know what is best at Video, Audio and Text Chatting. Which one is more effiecint. Should I use Websockets for all of them or webRTC for Video and Audio and Websockets for Text Chat. I can do both and wouldn't like to have to re-write my text chat for webRTC but if it is a better option then I will.
EDIT: I've just found out about binaryJS, Is this a better and easier alternative to webRTC?
Thanks,
#_C1D
By embedding your video and audio streams in websockets, you'll have a simpler system but everything will have to pass through your server.
WebRTC allows for a direct connection between pairs, so you'd get much better results using it.
Note also, but you probably know it already, that everything webRTC is just emerging.
Regarding the question in edit, about binaryJS : I never tried that but it doesn't look like a deal changer, just a facility for using websockets.

Are there any programs to record through a microphone that work inside a web browser?

I had a someone ask me if it were possible to record a person's voice inside of a web-browser - similar to what can be done on many operating systems. Is this possible through javascript or flash? Are there any programs that let you do this, and have the wav/mp3 of the recorded audio uploaded to the server? I'd prefer the solution to not use Flash if it can be avoided.
Thanks
You could use WAMI-Recorder. It still uses flash, but is designed to work with Javascript and data can be sent with HTTP POST. However, there's no way to access the microphone with Javascript alone.
At the moment, Chrome is the only browser that supports x-webkit-speech which is what they use to allow users to use voice to search Google on their desktop. HTML5 has getUserMedia, but support for that is also minimal and if your project is for mass consumption then it's unlikely to be a suitable.
Hey check out this post where i replied to a guy with a similar question as you.
How do I embed a Flash audio recorder in my site
I have done extensive research into client side only microphone recording and could not come up with any solution other than flash. If you follow my correct answer in the thread i posted, you can record audio from a microphone on the client side and then you can modify the code yourself and upload the audio to your server, its not that hard just a simple POST call.
If you do find a non-flash way to record let us know!

Javascript library for recording user audio?

This isn't another one of those "How can I record audio in the browser?" questions... I know that the HTML5 Stream API is around the corner and Flash can already access the user's microphone and camera. I'm simply wondering, as a Javascript developer with little knowledge of Flash, if anyone has developed a JS library that hooks into Flash's device capabilities for recording but sends the results back to javascript (presumably using ExternalInterface).
In other words... libraries like SoundManager2 utilize a Flash fallback for audio playback, but they don't seem to allow for recording. Has anyone written a JS library that uses an invisible Flash movie to allow audio recording?
This does most of what you're looking for:
https://code.google.com/p/wami-recorder/
It records audio and sends it to a server via an HTTP POST (avoiding the need for a Flash Media Server.) A JavaScript API is available via ExternalInterface.
I'm not sure why you'd want the audio bytes in JavaScript, but it would probably be easy to modify it to do that too.
Unfortunately, you can't really do Flash audio recording in browser only. The Flash audio interfaces are all designed (surprise surprise) to talk to a Flash media server (or Red5): there is no interface to store recorded audio data locally and pass the recorded audio data to Javascript.
Once you have Red5/FMS setup you can control the recording process from Javascript: you can start/stop/playback the audio stream to/from the server. However, for security reasons you have to have a flash movie that is a minimum of 216 x 138 (see http://blog.natebeck.net/2009/01/tip-of-the-day-tricks-of-the-mic-settings-panel/ for a writeup) otherwise the settings manager won't be shown: this prevents people hiding an audio recording flash widget on a page and eavesdropping.
So no, no invisible flash controlled from javascript.

Categories