Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Is it possible to convert a 30 second clip of an .mp3 to .wav in Ubuntu terminal? For example if I had an .mp3 that was 3:00 minutes long, would I be able to create a 30 second clip from 0:45-1:15?

I'm able to convert the entire song using mplayer in Ubuntu.

mplayer \
  -quiet \
  -vo null \
  -vc dummy \
  -ao pcm:waveheader:file="output.wav" "input.mp3"

I'm open to suggestions using mplayer, LAME, mpg123, mpg321 or other encoders!

share|improve this question

2 Answers 2

up vote 11 down vote accepted


ffmpeg -ss 45 -t 30 -i file.mp3 output.wav

(start at 45s, length 30s)

More info:

share|improve this answer

Use that same mplayer command and add options

-ss 45 -endpos 30
share|improve this answer
Hey David, Thanks so much for answering the question even though a "best answer" was selected. I appreciate it. – user784637 Aug 27 '11 at 20:53
No problem. I just think support forums should be complete, you know, for future archaeologists. – David Andersson Aug 28 '11 at 15:55

Your Answer


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.