[SOLVED] convert command is great for images but i need to convert audio
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
convert command is great for images but i need to convert audio
when i need to convert the format of an image file i use the convert command. i thought it was odd to give it such a generic name. why not "convert-image"? that way someone can make such a command for other stuff.
i need to do some audio format conversion and need a non-interactive non-GUI command that works like convert does so i can build some automation scripts around it. so far all i have found are projects that want to become audio or A/V editors of the GUI nature.
anyone know of commands or programs like i nee? especially great would be a feature of understanding the format i want based on the file name extension.
Code:
convert mysound.flac mysound.mp3
but i can add that kind of thing by scripting around it. it needs to be non-interactive and non-GUI to work in a script.
The ArchWiki has a section on scripts.
The use of FFmpeg with parallel looks nifty.
i hope they understand ffmpeg's options. i sure don't. i have used it, before, but via a script someone else wrote, like youtube-dl. i'll have a look and see if i can make it do WAV to FLAC. if i can do that change, then i can do just about any format it supports the same way. i have achieved video conversion to WEBM that way.
For reference. "The convert program is a member of the imagemagick(1) suite of tools"
right.
i would like to see things change so that command name can be used for any kind of conversion, not just images and sound. but this is a rather involved program:
i would like to see things change so that command name can be used for any kind of conversion, not just images and sound. but this is a rather involved program:
And you can create and publish your own convert tool.
too many replies, all good ones, to answer individually. thanks everyone. looks like sox or a well scripted ffmpeg should do the job.
Good deal - if you get a nice script going please post back with it. I've never before tried changing 'flac(s)' audio.
I've used something like this to 'convert' folders of .m4a files to .mp3 and .wav.
Code:
for f in *.m4a; do ffmpeg -i "$f" -acodec libmp3lame -ac 2 -ab 192k "${f%.*}.mp3"; done
Code:
for f in *.m4a; do ffmpeg -i "$f" -ar 8000 -acodec pcm_u8 -ac 1 "${f%.*}.wav"; done
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.