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?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityNote : What you want isn't directly possible with
mpg123
. I recommend using SoX instead -- the "Swiss Army Knife of sound processing".
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
-r
option, inserted before the output file name, indicates that you want to resample the output to 44100 Hz.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
).-V3
is optional and simply tells sox
to display the input/output parameters and transcoding progress for your information.