mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-08 13:13:47 -05:00
Fixed XLD audio conversion.
This commit is contained in:
@@ -493,16 +493,17 @@ convertMusic() {
|
||||
|
||||
# FLAC TO ALAC
|
||||
if [[ "${userOutput,,}" == "alac" ]]; then
|
||||
if type_exists "xlds"; then
|
||||
if type_exists "xld"; then
|
||||
XLD=1
|
||||
# audioConvertCommand="--profile FLACtoALAC"
|
||||
#audioConvertCommand="--profile FLACtoALAC"
|
||||
audioConvertCommand="-f alac" && verbose "Using XLD. audioConvertCommand = -f alac"
|
||||
outputFormat="m4a"
|
||||
else
|
||||
audioConvertCommand="-acodec alac" && verbose "Using ffmpeg. audioConvertCommand = -acodec alac"
|
||||
outputFormat="m4a"
|
||||
fi
|
||||
elif [[ "${userOutput,,}" == "flac" ]]; then
|
||||
if type_exists "xlds"; then
|
||||
if type_exists "xld"; then
|
||||
XLD=1
|
||||
audioConvertCommand="-f flac" && verbose "Using XLD. audioConvertCommand = -f flac"
|
||||
else
|
||||
@@ -613,6 +614,7 @@ function doConvert() {
|
||||
else
|
||||
verbose "xld -o "${output}" ${audioConvertCommand} "${f}""
|
||||
xld -o "${output}" ${audioConvertCommand} "${f}"
|
||||
deleteOriginalFile
|
||||
fi
|
||||
else # Use ffmpeg when XLD is set to 0
|
||||
# Respect --safe flag.
|
||||
@@ -621,8 +623,13 @@ function doConvert() {
|
||||
else
|
||||
verbose "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
|
||||
rm -f $v "${f}"
|
||||
#remove '.new' from filename
|
||||
@@ -636,8 +643,6 @@ function doConvert() {
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
runScript() {
|
||||
|
||||
Reference in New Issue
Block a user