Azimout's Linux weblog

merging mp3 files with sox

with 6 comments

To merge multiple mp3 files into one, use sox like this:

sox –combine sequence input1.mp3 input2.mp3 … output.wav

I’m outputing to wav because if you try to output to mp3, you get

SoX was compiled without MP3 encoding support

which is already reported as bug #223783

Afterwards, to convert from wav to mp3, use lame:

lame input.wav output.mp3

or, to set output to mono, 48kbps, 44.1kHz, VBR:

lame -v -m m -B 48 -s 44.1 input.wav output.mp3


Written by azimout

31/01/2009 at 21:24

Posted in Howto

6 Responses

Subscribe to comments with RSS.

  1. Hi, Sorry for my english.
    Excelent post,
    I´m looking for that,
    But It do not work on windows say:
    sox formats: no handler for file extension ‘mp3’

    I’m reading the docs and it say:

    SoX cannot be distributed with MP3 support.

    Do you can help me.

    I need it.



    09/03/2009 at 17:08

  2. jeison, looking at the description of sox (through “aptitude show sox”) I can see:

    SoX is able to handle formats like Ogg Vorbis, MP3, WAV, AIFF, VOC, SND, AU, GSM and several more. Any format support requires at least libsox-fmt-base. Some formats have their own package e.g. mp3 read support is provided by libsox-fmt-mp3.

    Have you installed libsox-fmt-mp3 ???


    09/03/2009 at 17:19

  3. for those who want mp3 support for sox in windows.
    mail me. I have a build. same issue here also output as wav


    03/07/2009 at 06:08

    • santhash – how can I get your email address? I’d love a copy of SoX with MP3 support, but I don’t know how to compile it myself. My email address is aaelghat at gmail dot com


      21/07/2009 at 04:19

    • Please give me sox for windows with mp3 support.
      Thanks and sorry for my bad english 😉


      04/12/2009 at 15:36

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: