Fade in/out audio?

Is there any javascript out there that can help me with a fade in and then fade out of an uploaded mp3 file?
I have a 30 second sample of a track on a web site. I want the file to have a little fade in of the beginning of the track and then a little nice fade out in the end of the track.
Since I have different tracks and users uploading the samples, I need to make this automatic. Don’t think everyone knows how to make a fade in to their tracks.

Even better if I could use a complete mp3 file and tell the code what 30 second part of the track should be used as a sample.
Any ideas where to find something like this?

This is what it should be like:
There will be a web page, where a guest will show up.
There will be a 30 sec sample of a track that a user have uploaded when the guest click on the track name.
Would be nice to have a little fade in/out to that part.