File: convert_audio.sh

package info (click to toggle)
bashburn 3.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 1,140 kB
  • sloc: sh: 2,584; sed: 64; makefile: 19
file content (30 lines) | stat: -rwxr-xr-x 673 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
convert_audio()
{
    typeset filetype="$1"
    shopt -s nocaseglob
    if [[ "$filetype" == '*.flac' ]]
    then
	${BB_FLACCMD} -d *.flac
	message "$bb_conv_flac_1"
    elif [[ "$filetype" == '*.mp3' ]]
    then
	typeset bbmpthree
	while read bbmpthree
	do
	    echo
	    if ${BB_MP3DEC} -r 44100 -w "${bbmpthree%%.mp3}.wav" "${bbmpthree}"
	    then
		echo "${bbmpthree}: $bb_conv_mp3_1 (${bbmpthree%%.mp3}.wav) $bb_conv_mp3_2"
	    else
		echo "${bbmpthree}: $bb_conv_mp3_3"
	    fi
	    echo
	done < <(find ${BBBURNDIR} -iname '*.mp3')
	sleep 2s
    elif [[ "$filetype" == '*.ogg' ]]
    then
	${BB_OGGDEC} *.ogg
	message "$bb_conv_ogg"
    fi
    shopt -u nocaseglob
}