This transcodes the entire .mp3 to a .wav

mpg123 -w output.wav input.mp3

Is there any way I can transcode a portion from the 10 second mark to the 20 second mark at a 44100hz?

1 Answer 1


Note : What you want isn't directly possible with mpg123. I recommend using SoX instead -- the "Swiss Army Knife of sound processing".

Transcoding only a portion of an MP3 file to WAV and resampling it to a different rate

  • Install SoX along with MP3 format support from the terminal with sudo apt-get install sox libfmt-sox-mp3

  • You can then perform the transcoding you require via this command:

    sox -V3 input.mp3 -r 44100 output.wav trim 0:10 0:10
    • The -r option, inserted before the output file name, indicates that you want to resample the output to 44100 Hz.
    • The trim option, inserted after the output file name, indicates that you want to transcode only the portion beginning at 0 minutes and 10 seconds (first 0:10), for a length of 10 seconds from that point (second 0:10).
    • The -V3 is optional and simply tells sox to display the input/output parameters and transcoding progress for your information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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