-
You need
ffmpeg
installed. If you have Homebrew installed on a Mac, you can do this by running:brew install ffmpeg
-
Put
process.sh
in directory containing.ogg
files. -
Ensure it's executable:
chmod +x process.sh
-
Run it, to convert each
.ogg
file to a.mp3
file:./process.sh
-
If a file is named
track.ogg
, the resulting.mp3
file will be saved in the same directory astrack.mp3
.
-
-
Save sorahn/f9c7b0af2d9311511da38f4a6d0fbb89 to your computer and use it in GitHub Desktop.
Convert a directory of .ogg files to .mp3 files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
for f in *.ogg; do | |
out=$(echo $f | sed -e "s/.ogg/.mp3/g") | |
echo "Processing: $f" | |
ffmpeg -i "$f" -acodec libmp3lame "$out" | |
echo "Saved: $out" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment