dam/src/gen_image

33 lines
764 B
Text
Raw Normal View History

2018-04-08 16:31:53 -04:00
#!/bin/bash
# doc gen_image {
#
# DESCRIPTION
# gen_image - Generates image from list of lossless audio files
#
# USAGE
# gen_image <file_1> [<file_1>] [<...>]
#
# }
gen_image() {
local fileList=("${@}")
if [[ ${#fileList[@]} -eq 1 ]]; then
cat ${fileList[@]} > joined.flac
else
shntool join -O always ${fileList[@]} -o flac
if [[ $? -ne 0 ]]; then
med_convert wav ${fileList[@]}
[[ $? -ne 0 ]] && return 1
2018-04-08 16:31:53 -04:00
echo ${fileList[@]}
fileList=($(printf '%s\n' ${fileList[@]} | sed 's|flac|wav|'))
echo ${fileList[@]}
shntool join -O always ${fileList[@]} -o flac
[[ $? -ne 0 ]] && return 1
return 2
2018-04-08 16:31:53 -04:00
fi
fi
return 0
2018-04-08 16:31:53 -04:00
}