Log in

View Full Version : Audio Upload/Handling



djr33
10-23-2009, 06:06 AM
I am thinking about building a website that includes user-uploaded audio. Considering most users won't know how to save a file with their microphone, compress that file in a reasonable way, then upload the file, I would like to find a way to automate the process as much as possible.

1) Is there a way to record audio within a webpage and save this to the server? I know Flash has some ability to interact with microphones, but I have no idea where to even start with trying to then send it to the server. There may also be another way.
I'm fine using plugins here (flash preferred, I guess) considering there probably isn't another way and at least it will be easier than doing it independently then uploading, even if it involves first installing a plugin to the browser.

2) Once I have the audio file (whether recorded on the webpage or uploaded from the user's recorded file), is there any way to manipulate the files on the server? Specifically I would like to recompress to a low filesize and standard format (probably mp3). I'd like something like the GD library for images in PHP, but perhaps the only way to try this would be to run an executable converter on the server when the files are uploaded.


Any other general ideas would be helpful. I don't think just telling users to "please upload a well compress mp3 of your recording" would get very far, and I can't think of an easy way to approach this with PHP, etc.
In theory I could just do it all manually, but that would be a slow turnaround and annoying.

djr33
10-29-2009, 01:57 AM
After searching google for a while, I'm happy with the results.

http://www.javasonics.com/

It's available for free, limited use (small ad in the applet; limits each recording to max. 60 seconds), or $400 for an unlimited license.

It's Java, not Flash, and it works pretty well. As it says on the site it "throws" the file using POST data and you "catch" it with whatever serverside scripting you want-- just like a regular file upload form.

The compression is good (~320kb for 60 seconds), and the wav files seem compatible with other players (like quicktime). It has another format ("speex") with a better compression ratio but it seems to only be compatible with their player.

Documentation is included.

Check it out if you have a similar situation to mine.