Skip to content

Instantly share code, notes, and snippets.

@nickferrando
Created May 9, 2020 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickferrando/ff3512edebec381ad2a6cf16a82ce223 to your computer and use it in GitHub Desktop.
Save nickferrando/ff3512edebec381ad2a6cf16a82ce223 to your computer and use it in GitHub Desktop.
Convert WAV files into Multiple Audio Formats
#!/bin/bash
#Convert input files in .WAV format to multiple destinations
#AIFF, Mp3 @64Kbps, Mp3 @128Kbps, AAC @192k and FLAC format.
#It will also copy the metadata informations, where they exists.
mkdir aiff mp3-64 mp3-128 aac-192 flac
for i in *.wav; do ffmpeg -i "$i" -nostdin -map_metadata:s:a 0:s:a "./aiff/${i%.*}.aiff" -b:a 64k "./mp3-64/${i%.*}.mp3" -b:a 128k "./mp3-128/${i%.*}.mp3" -b:a 192k "./aac-192/${i%.*}.aac" "./flac/${i%.*}.flac"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment