Find and convert

Definitely in the note-to-self category, I needed to convert several subfolders of mp3 files to ogg format, and it took a little while to find a combination of find and mp32ogg that would play nice together. In the end, it was this combination, along with xargs, that did the trick.

find . -print0 -iname *mp3 | xargs -0 mp32ogg --delete --verbose --preserve-timestamp

Not pretty, but it saves me endlessly changing directories to convert all those subfolders.

I know what you’re thinking — it’s just a script, and it supposedly will recurse directories. For whatever reason, all my attempts to push the script itself to step down through the file structure were not working, and hence the creepy CLI solution.

And I know what you’re thinking — I’ve degraded the quality by converting between lossy formats. Doesn’t matter; these are voice recordings, and rather poor quality to start with. I’m not losing anything.

1 thought on “Find and convert

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s