Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create mp3 previews from wav and aiff files

Tags:

audio

mp3

wav

aiff

I would like to create a program that makes mp3s of the first 30 seconds of an aiff or wav file. I would also like to be able to choose location and length, such as the audio between 2:12 and 2:42. Are there any tools that lets me do this?

Shelling out is OK. The application will run on a linux server, so it would have to be a tool that works on linux.

I don't mind doing it in two steps - i.e. a tool that first creates the cutout of the aiff/wav, then pass it to a mp3 encoder.

like image 907
August Lilleaas Avatar asked Feb 28 '23 07:02

August Lilleaas


1 Answers

SoX with the trim predicate can do this. If your sox is not built with MP3 support then you'll have to pipe the output to lame after, or find one that is.

like image 169
Ignacio Vazquez-Abrams Avatar answered Mar 04 '23 09:03

Ignacio Vazquez-Abrams