L
L
lugansk2011-01-12 23:18:43
Java
lugansk, 2011-01-12 23:18:43

Capturing sound from a microphone by a browser (methods)

In the future, it may be necessary to store short (up to 30 seconds) recordings of speech from a microphone (not a chat) on the server, preferably directly from the browser.

So, what comes to mind about the implementation options:

1. Flash - it's clear: Microphone.get(); attachAudio...

Server side FMS/Red5 only? Can't do without a media server? The case seems to be the simplest, streaming is not needed, is it possible to get by with something simple in php / perl?

2. Silverlight - something like that , well, or a crutch .

3. ActiveX object?

4. HTML5 - not yet, or is something experimentally supported somewhere?

5. Java applets?

6. Media player browser plugins - QuickTime, VLC, WMP, etc. - only for playback or some of them can record sound?

7. What else?

Please unsubscribe with code examples/thematic links, thanks.



UPD. Something does not add up with Java: recording sound from a microphone , sending it to the server is also not a problem, but to use it as an applet on a page, you will have to sign it with a certificate . Or is it possible to bypass it somehow?

Answer the question

In order to leave comments, you need to log in

8 answer(s)
R
Riateche, 2011-01-12
@Riateche

According to Google, VLC can somehow be forced to record sound / video. But I have no idea how to organize its interaction with the browser for this.
Java seems to me the most convenient solution. Seems you need something like this: www.hotscripts.com/listing/clipstream-playerless-java-media-streaming/

B
BasilioCat, 2011-01-13
@BasilioCat

Flash in version 8 (or even earlier) encoded the sound captured from the microphone with the proprietary and closed Nellymoser codec, of course it is decoded by Flash itself, but to legally convert it to mp3, you had to buy an SDK for 30 bucks. Work on decoding it in libavcodec was underway, it seems to me that the developers of Red5 offered even 5 thousand to those who write an open source decoder. Wikipedia states that FFMPEG can now decode Nellymoser.
In Flash 10, it seems like it is possible to select the Speex codec, while the same Nellymoser is used by default
With all this, sending a stream is possible only to FMS/Red5/Wowza and other rtmp media servers. There is also erlyvideo, there are implementations of rtmp in python - I'm not sure, however, that they can receive streams. In any case, an HTTP POST request is not enough, it will require a process that is ready to constantly accept connections and write streams

E
Emin, 2011-01-13
@Emin

An example of how to record an audio file using a microphone and a flash player can be found here:
active.tutsplus.com/tutorials/actionscript/create-a-useful-audio-recorder-app-in-actionscript-3/
flash server can be read here:
livedocs.adobe.com/flex/3/html/help.html?content=17_Networking_and_communications_7.html
I'm sure that by combining the code from the two links above, you can easily solve your problem.

L
lsdima, 2011-01-13
@lsdima

If flash, then a media server is not required. Inside the flash, the signal from the microphone is stored in a bitmap. Next, look for suitable coding libraries. Offhand, Google gave out:
blog.debit.nl/2009/03/mp3-encoder-in-flash-with-alchemy/
github.com/kikko/Shine-MP3-Encoder-on-AS3-Alchemy
By the way, you can do without encoding, or encode on the server side.
I won’t tell you in nuances, because. I didn’t have to work with a microphone, but in general, somewhere like that.

T
tikhop, 2011-01-13
@tikhop

I personally recorded from a microphone using flash, I did not use a media server. Flash can receive an array of bytes from a microphone, then this array of bytes is converted to wav and saved to the server.
tikhop.com/temp/hollur/br/

D
darkkosinus, 2012-02-20
@darkkosinus

habrahabr.ru/blogs/webdev/136605/

W
wartur, 2013-01-30
@wartur

www.sajithmr.me/jrecorder-jquery

E
Evgeny Koff, 2016-04-05
@Komarov_E

the article on habré was https://habrahabr.ru/post/198632/
here is the link to the scripts www.scriptcam.com

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question