Skip to content

Instantly share code, notes, and snippets.

@JT5D
Created February 27, 2017 05:57
Show Gist options
  • Save JT5D/340bc20e8cdeb4727f0cfdb218ea4ae7 to your computer and use it in GitHub Desktop.
Save JT5D/340bc20e8cdeb4727f0cfdb218ea4ae7 to your computer and use it in GitHub Desktop.
Script + FFmpeg command to batch-convert directory of WAVs to MP3s
#!/bin/bash
for f in *.wav; do ffmpeg -i "$f" -ab 320k "${f%.wav}.mp3"; done
#run this script on an scheduled cron job or from the command line.
#to run this script from the command line, open your terminal & cd into your folder of WAVs like so: 'cd myfolder'. hit return.
#now type 'sh FFmpeg-batch-convert-wavs-to-mp3s.sh'. hit return to run the script & watch the magic.
#all converted MP3s will be placed in the same directory as the original WAVs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment