Recording Audio Via JWS and XFer Using ftp

I need to make a simple app that can record speech for me. This application will be used by non-technical people, who have little to no understanding of audio formats, specs, etc.

This is what intend to do -

  • Record audio on the users computer
  • Play audio on the users computer
  • Save the audio to a file on their computer
  • Send the file to my computer
  • Run using JWS

My thought is to run a simple ftp server on my computer (on a non-standard port). The app would ftp the audio files up after they have been recorded.

The user would do the following -

1 - Run the app via JWS
2 - Press a button to start the recording
3 - The screen would present a word to the user, which they say
4 - The app pauses a few seconds and the shows another word
5 - After say 10 words, the application automatically stops recording
6 - The file is transferred up to the server
7 - The repeat 2 - 6 a few times for different sets of words
8 - They are now done and exit the app

I’m sure there are ftp libraries out there for java. The thing I’m not sure of is how to do the recording, ie what approach - JMF, Java Sound, other?

Can you all share some experience and make some suggestions?

Cheers,
DrA>

Recording using JavaSound is easy (just check the tutorials). Make sure your JWS application is signed though, or else java’s security won’t let you record anything.

The thing is, as far as I know JavaSound can’t write any standard audio file format so you’ll have to do that yourself. You could use jorbis for that (so you’ll have compression too, since your saving it on the internet).

As for FTP, jftp is quite nice and easy to use and is a small jar. Jakarta commons-net works well too (and is more complete), but the jars are bigger (commons-net supports a bunch of other protocols too, and needs jakarta-oro to work).

Hi, about ftp, the basic java.net.URL class can manage single files transfers


URL url=new URL("ftp://user:password@ftp.website.com/dir1/dir2/file1.wav;type=i");

then you get an output stream with


cnx = url.getConnection();
out = cnx.getOutputStream() 

and you can write your data into it.
(don’t forget to close the connexion when you’re done)

Lilian :slight_smile:

Thank you both for the replies. I’ll have to poke around a bit and see how the implementation works out.

Thanks,
Dr.A>