Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to create snippets of mp3 songs using the first 30 seconds of each song. I want to apply the following actions on each mp3 song:

  1. Cut the first 30 seconds length of each song.
  2. Apply fade out effect at the end (from 28 secs to 30 secs)
  3. Save the file as another mp3 file.

This needs to be done in a batch as the number of songs is pretty large.

Is there any software which can do this?

I am on Windows 7.

Thanks

share|improve this question

1 Answer 1

I think you could use sox. You can grab a precompiled version that supports mp3 from this post on stackoverflow.

I've tried it with the following command line and it seems to do the job:

sox input.mp3 output.mp3 trim 0 30 fade t 0 30 2
     ^^1       ^^2        ^^3       ^^4
  1. input filename
  2. output filename
  3. trim the file from 0 to 30 seconds
  4. fade linear (t), fade-in-length 0, fade-out 'location' at 30 seconds with fade-out-length of 2

Then you only need to write a batch script, so it can (recursively) change all your desired mp3's.

They provide a batch-example.bat which might help you get started:

rem Example of how to do batch processing with SoX on MS-Windows.
rem
rem Place this file in the same folder as sox.exe (& rename it as appropriate).
rem You can then drag and drop a selection of files onto the batch file (or
rem onto a `short-cut' to it).
rem
rem In this example, the converted files end up in a folder called `converted',
rem but this, of course, can be changed, as can the parameters to the sox
rem command.

cd %~dp0
mkdir converted
FOR %%A IN (%*) DO sox %%A "converted/%%~nxA" rate -v 44100
pause
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.