There was a question on how to get data from a microphone on a client to a server via an HTTP browser, and the answer was "use flash or maybe a java servlet applet". Fine, but how? Is there any sample code or tutorial out there? Can it be done with a vanilla server or do I need adobe media server?
views:
1355answers:
3You will need to use flash media server. You can download it from adobe.com. It is free for 10 concurrent uses. You will find a tutorial at http://www.flashcomguru.com/tutorials/ and you can use www.influxis.com to host your app.
I believe that the answer was really "use flash or maybe a java applet" and not a "java servlet". For your problem you must implement two things:
- A client application running in the user's browser that captures audio and then connects to a remote server to upload files.
- A web application that accepts the uploaded files.
The client application must be implemented in a browser's plug-in technology, as it is impossible to record audio from the browser directly. This could be done with flash or a Java Applet. These aren't the only options, but they are the most common ones.
See this link for ActionScript code that access the microphone. The blogspot also interestingly describes what are your options with Silverlight.
For Java, this is a tutorial for audio recording. You would need to create an applet, which isn't very hard. A tricky issue is that you'd probably need to "sign" your applet in order to be able to access the microphone at the user's machine.
For the server side you can use any server technology and adobe media server is by no means required. Examples are PHP, Java (Tomcat), ASP.NET. The file uploading part you could even do it with just an Apache Web Server. All you need is to configure it to allow file uploads.
Update:
I agree with your comment that flash will be the best solution. You can find many examples in the net for accessing the microphone with ActionScript. This is what I have quickly found:
I recently posted an answer on a similar question which may apply here.
As far as I can tell, it may be possible with Flash 10 and the new access to the byte streams of the sound objects, but no one has done it yet. I'm not a Flash programmer myself, but I'd be willing to help out with the server component if you or anyone else would like to give a shot at cracking this nut.