Skip to content

Instantly share code, notes, and snippets.

@ElMassimo
Created September 7, 2017 18:08
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 ElMassimo/b17fafa1c57b852ec2e35bb0f6e395cd to your computer and use it in GitHub Desktop.
Save ElMassimo/b17fafa1c57b852ec2e35bb0f6e395cd to your computer and use it in GitHub Desktop.
Music Conversion (MP3 to WMA and WAV to MP3)
#!/bin/bash
find . "(" -iname "*.mp3" ")" -print0 | xargs -0 -I file mv file "../music/$file"
find . "(" -iname "*.wma" ")" -print0 | xargs -0 -I file ./convert_file file
#!/bin/bash
echo "$1"
mkdir -p "../music/${1%/*}"
ffmpeg -i "$1" -ab 320k "../music/${1%.wma}.mp3"
#!/bin/bash
# Converts a collection of *.wav files and stores them in the rehearsals folder.
if [ -z "$1" ]; then
echo "Please enter a path where the .wav files are located"
exit 1
fi
echo "Converting all *.wav files in $@"
find "$@" "(" -iname "*.wav" ")" -print0 | xargs -0 -I file ./convert_song file
#!/bin/bash
# Converts a single .wav file and stores it in the rehearsals folder.
yesterday=$(date -v-1d +%F)
mkdir -p "./$yesterday"
song=$(basename "$1")
echo "Converting: '$song'"
ffmpeg -i "$1" -vn -ar 44100 -ac 2 -ab 320k "./$yesterday/${song%.wav}.mp3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment