Created
September 7, 2017 18:08
-
-
Save ElMassimo/b17fafa1c57b852ec2e35bb0f6e395cd to your computer and use it in GitHub Desktop.
Music Conversion (MP3 to WMA and WAV to MP3)
This file contains 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 | |
find . "(" -iname "*.mp3" ")" -print0 | xargs -0 -I file mv file "../music/$file" | |
find . "(" -iname "*.wma" ")" -print0 | xargs -0 -I file ./convert_file file |
This file contains 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 | |
echo "$1" | |
mkdir -p "../music/${1%/*}" | |
ffmpeg -i "$1" -ab 320k "../music/${1%.wma}.mp3" |
This file contains 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 | |
# 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 |
This file contains 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 | |
# 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