Is there a way to make a fade in and fade out to a mp3 file that a user is uploading to my server?
I'm making a page where the user can upload their sound file and then I want my page to make a 30 sec sample of that sound.
Any ideas?
| SitePoint Sponsor |



Is there a way to make a fade in and fade out to a mp3 file that a user is uploading to my server?
I'm making a page where the user can upload their sound file and then I want my page to make a 30 sec sample of that sound.
Any ideas?
My first impulse is to say ffmpeg it.
PHP itself cant do this; javascript might, but that would involve the browser redownloading the entire audio file to do a 30 second sweep; probably not what you want.
Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.



And what is ffmpeg doing? Is that something I can use on my server and do with an uploaded file while the user is still logged in? Or what?
But uploading the complete file is no problem, since I want a full length audio track is also supposed to be uploaded. The 30 sec sample is just a teaser.

ffmpeg is a command-line program that processes and manipulates audio and video.
A quick search pulls up various threads on how to write a command to fade in and out, but there's some debate on if this actually affects audio volume or not.
Visit The Blog | Follow On Twitter
301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
Can be hosted on and utilize your own domain
Bookmarks