Fixed XLD audio conversion.

This commit is contained in:
Nathaniel Landau
2016-01-03 19:23:52 -05:00
parent 2618b7cbe4
commit a3406fa571

View File

@@ -493,16 +493,17 @@ convertMusic() {
# FLAC TO ALAC # FLAC TO ALAC
if [[ "${userOutput,,}" == "alac" ]]; then if [[ "${userOutput,,}" == "alac" ]]; then
if type_exists "xlds"; then if type_exists "xld"; then
XLD=1 XLD=1
# audioConvertCommand="--profile FLACtoALAC" #audioConvertCommand="--profile FLACtoALAC"
audioConvertCommand="-f alac" && verbose "Using XLD. audioConvertCommand = -f alac" audioConvertCommand="-f alac" && verbose "Using XLD. audioConvertCommand = -f alac"
outputFormat="m4a"
else else
audioConvertCommand="-acodec alac" && verbose "Using ffmpeg. audioConvertCommand = -acodec alac" audioConvertCommand="-acodec alac" && verbose "Using ffmpeg. audioConvertCommand = -acodec alac"
outputFormat="m4a" outputFormat="m4a"
fi fi
elif [[ "${userOutput,,}" == "flac" ]]; then elif [[ "${userOutput,,}" == "flac" ]]; then
if type_exists "xlds"; then if type_exists "xld"; then
XLD=1 XLD=1
audioConvertCommand="-f flac" && verbose "Using XLD. audioConvertCommand = -f flac" audioConvertCommand="-f flac" && verbose "Using XLD. audioConvertCommand = -f flac"
else else
@@ -613,6 +614,7 @@ function doConvert() {
else else
verbose "xld -o "${output}" ${audioConvertCommand} "${f}"" verbose "xld -o "${output}" ${audioConvertCommand} "${f}""
xld -o "${output}" ${audioConvertCommand} "${f}" xld -o "${output}" ${audioConvertCommand} "${f}"
deleteOriginalFile
fi fi
else # Use ffmpeg when XLD is set to 0 else # Use ffmpeg when XLD is set to 0
# Respect --safe flag. # Respect --safe flag.
@@ -621,8 +623,13 @@ function doConvert() {
else else
verbose "ffmpeg -i "${f}" ${videoResize} ${videoCommand} ${videoAudioCommand} ${audioConvertCommand} "${output}" ${ffquiet}" verbose "ffmpeg -i "${f}" ${videoResize} ${videoCommand} ${videoAudioCommand} ${audioConvertCommand} "${output}" ${ffquiet}"
ffmpeg -i "${f}" ${videoResize} ${videoCommand} ${videoAudioCommand} ${audioConvertCommand} "${output}" ${ffquiet} ffmpeg -i "${f}" ${videoResize} ${videoCommand} ${videoAudioCommand} ${audioConvertCommand} "${output}" ${ffquiet}
deleteOriginalFile
fi
fi
# delete original if requested and remove '.new' from new file }
function deleteOriginalFile() {
if ${deleteOriginal}; then if ${deleteOriginal}; then
rm -f $v "${f}" rm -f $v "${f}"
#remove '.new' from filename #remove '.new' from filename
@@ -636,8 +643,6 @@ function doConvert() {
done done
fi fi
fi fi
fi
fi
} }
runScript() { runScript() {