Can I record audio from client to server in an online application based on PHP or JAVA?

I am creating an online application that offers customers to test their language skills.

The application consists of a series of different tests that customers are free to perform. One of these tests is one where the client sees the offer on the web page and then has to speak the offer on the microphone. The idea would be to record an audio stream, send it to the server and save it in a file.

Is this possible using PHP, Java, or something similar to them?

Thanks for any help :)

+7
source share
5 answers

The only realistic solutions to solve the problem are with a flash, as suggested by another answer, or a Java applet. In a year or two, which I hope will change, and you can use javascript and HTML5, but it is now.

I would say that this problem is better and easier to solve with flash, but for java you need to write a Java applet for writing. Here are some tips to get you started:

http://docs.oracle.com/javase/tutorial/deployment/applet/ http://www.java2s.com/Tutorial/Java/0120__Development/CapturingAudiowithJavaSoundAPI.htm http://www.jsresources.org/

You don't need a java speech API or JMF, just java sound. You may WANT JMF to compress the audio file to speed up the download, but you can work without it. Please note that you may need to “sign” your applet for recording sound in a browser.

If you cannot blink, you can also use haxe to write your flash code.

+7
source

I know that you asked for PHP, I assume your language of choice, but you thought you used html5 to record your audio? Note: browser support is still not available, but it may be worth a look depending on your requirements.

Check out the tutorial ; It uses the GETUSERMEDIA API to access your equipment with a camera and microphone.


Update: here is another good tutorial on this.

+8
source

Not 100% of what you are looking for, but I think this will at least give you some ideas.

How to record streaming audio to a server

+2
source

You can solve this problem using Flash and Java. You can use the Flash component to record sound and send it to chunks on the server side, which can be implemented using java.

The advantages of creating a sound recorder in Flash are many.

  • Flash is a widely installed browser plugin
  • The Java applet gives a warning before starting, which disconnects users many times.
  • It is checked dimensionally, most multimedia applications are created using Flash, thereby providing you with good support.
  • Java applets are used where the thick client should fit into the browser and also be safe. You will still find many real-time drag-and-drop applications written in java applets.

Here are some tutorials on creating Sound Recorder in Flash

http://active.tutsplus.com/tutorials/actionscript/create-a-useful-audio-recorder-app-in-actionscript-3/

Adobe Sound Recording and Saving

This collected audio stream can be stored in chunks on the client side and can be synchronized with the server server (any language on the server side must be accurate.).

Implementing your server in Java has an advantage. If the need arises in the future, you can transfer the same sound using the Red5 server, which is implemented in Java.

More details here: http://www.red5.org/

+1
source

To do this, there is a sound recording SDK, which is written in PHP, Flash and HTML5. http://recordmp3online.com

I am actually the author of this SDK (full disclosure)

0
source

All Articles