43 lines
1.5 KiB
Bash
43 lines
1.5 KiB
Bash
#!/bin/bash
|
|
encodeFile::vorbis() {
|
|
oggencopts=(${ionice}oggenc -Q -q ${destinationquality[$destination]})
|
|
[ -n "$albumartist" ] && oggencopts+=(-c "ALBUMARTIST=$albumartist")
|
|
[ -n "$album" ] && oggencopts+=(-l "$album")
|
|
[ -n "$artist" ] && oggencopts+=(-a "$artist")
|
|
[ -n "$composer" ] && oggencopts+=(-c "COMPOSER=$composer")
|
|
[ -n "$disc" ] && oggencopts+=(-c "DISCNUMBER=$disc")
|
|
[ -n "$genre" ] && oggencopts+=(-G "$genre")
|
|
[ -n "$performer" ] && oggencopts+=(-c "PERFORMER=$performer")
|
|
[ -n "$title" ] && oggencopts+=(-t "$title")
|
|
[ -n "$track" ] && oggencopts+=(-N "$track")
|
|
[ -n "$year" ] && oggencopts+=(-d "$year")
|
|
oggencopts+=(-o "$destdir/$destfile.ogg" "$tempdir/$tmpfile.wav")
|
|
encodetaskid=$(
|
|
Insert tasks <<-EOInsert
|
|
key ${fileid}oggenc$destination
|
|
requires ${soxtaskid:-$decodetaskid}
|
|
required ${soxtaskid:-$decodetaskid}
|
|
fileid $destfileid
|
|
filename $destdir/$destfile.ogg
|
|
$(
|
|
for key in ${!oggencopts[@]}
|
|
do
|
|
cleanedopts="${oggencopts[key]//\&/\\\&}"
|
|
cleanedopts="${cleanedopts//\[/\\[}"
|
|
cleanedopts="${cleanedopts//\]/\\]}"
|
|
cleanedopts="${cleanedopts//\{/\\{}"
|
|
cleanedopts="${cleanedopts//\}/\\\}}"
|
|
echo "cmd_arg$key ${oggencopts[key]}"
|
|
done
|
|
)
|
|
cleanup $tempdir/$tmpfile.wav
|
|
source_file $fileid
|
|
status 0
|
|
rename_pattern ${destinationrenamepath[$destination]}/${destinationrename[$destination]}
|
|
fat32compat ${destinationfat32compat["$destination"]}
|
|
ascii ${destinationascii["$destination"]}
|
|
EOInsert
|
|
)
|
|
progressSpin
|
|
}
|