I have been struggling a lot on this problem and you are my last chance.
My users will be uploading mp3s on my server, I am trying to get all the mp3s to fade out after 1 minute or even better at the half of each song.
I have this code:
shell_exec('/usr/bin/sox input_file.mp3 output_file.mp3 fade t 0 200 5');
It works well with other effect but not with fade out.
The SOX manual says that the middle number "t 0 200 5" should be the length of the track, the last number the fade out length and the first number the fade in length but there is a problem, it is impossible for me to know the middle number in advance because others will be uploading the songs and not me, any any how to change this script in order to accept any song length?