how do I convert audio file formats with the command line

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
svesmeralda

how do I convert audio file formats with the command line

Post by svesmeralda »

I am using Linux Mint 11 on a Toshiba NB505 Netbook. I would like to be able to convert a group of audio files from one format to another such as mp3 to ogg and vice versa. Is there a script or app that will do this? Thanks for any help. :D

Jim
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Anakinholland

Re: how do I convert audio file formats with the command lin

Post by Anakinholland »

Hya Jim,

The tool you're most likely looking for is ffmpeg.

Regards,

Anakin
svesmeralda

Re: how do I convert audio file formats with the command lin

Post by svesmeralda »

:D
Anakin,

ffmpeg is what I was looking for, however it did not work out of the box for me on either this machine or the one with Ubuntu 10.04. I did some research on Ubuntu and found what I needed to get the job done.

From: http://ubuntuforums.org/showthread.php?t=766683

I was able to get ffmpeg to work. The first step to enable the medibuntu repositories failed, but they are already enabled on Mint so it was no matter. The second step failed initially because two of the apps could not be found, rubyripper and gnome-sushi. I removed them from the command and it ran fine after that. For my purposes they were not needed.

I did not accept the EULA for the MS fonts and that seems to have no effect, either.

From: http://ubuntuforums.org/showthread.php? ... mmand+line

I found this one line script to automate the job:

Code: Select all

for f in *.wav; do ffmpeg -i "$f" -ab 320k "${f%.wav}.mp3"; done
I cd-ed into the files' directory and am running this script right now converting about 30 ogg files to mp3. It seems to be working just fine. This additional script can be added right after .mp3",

Code: Select all

&& rm "$f"
to remove the original file. I am not doing that at this time but will try it later.

If I post again it will be because something went wrong with the formating of the mp3 files.

Thanks for directing me to ffmpeg.

Jim
Locked

Return to “Sound”