Created
January 31, 2015 19:29
-
-
Save keiya/d2598c25d1dc7bec425b to your computer and use it in GitHub Desktop.
multiple wav/aiff audio file to ogg/flac/he-aac v2 converter.
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 | |
| # usage: | |
| # bash audio_convert.bash ORIGINAL_FILEs_PATH DESTINATION_PATH | |
| find $1 -type f -iname '*.wav' -print0 | while IFS= read -r -d '' fullfile; do | |
| #printf '%s\n' "$fullfile" | |
| file=$(basename "${fullfile}") | |
| ## OGG, lossy, recommended for most uses | |
| oggenc -q4 "${fullfile}" -o "${2}${file}.ogg" | |
| ## FLAC, lossless | |
| # flac -8 "${fullfile}" -o "${2}${file}.flac" | |
| ## HE-AAC v2 (AAC LC+SBR+PS / MP4) 32kbps, recommend for voice | |
| # afconvert -v -f m4af -d aacp -b 32000 "${fullfile}" -o "${2}${file}.m4a" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment