File: audiosync

package info (click to toggle)
bayonne 2.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 11,180 kB
  • ctags: 3,662
  • sloc: cpp: 38,791; sh: 9,323; ansic: 1,391; makefile: 485; perl: 471; java: 405; cs: 402; php: 354; python: 293
file content (44 lines) | stat: -rwxr-xr-x 776 bytes parent folder | download
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh

if test -z "$*" ; then
	echo "audiosync: missing root directory"
	exit -1
fi

if test ! -d "$*" ; then
	echo "audiosync: $*: root directory invalid"
	exit -1
fi

EXTENSION=".au"
ENCODING="gsm alaw"
PADDING=""
FRAMING="10"

if test -f ~/.audiosync ; then
	source ~/.audiosync ; fi

pwd=`pwd`
dirlist=`find $* -type d`
for dir in $dirlist ; do
	cd=${pwd}
	echo "scanning $dir..."
	cd ${dir}
	for voice in *$EXTENSION ; do
		base=`basename $voice $EXTENSION`
		if test ! -z "$PADDING" ; then
			audiotool -trim -padding=$PADDING -framing=$FRAMING $voice ; fi

		for enc in $ENCODING ; do
			case $enc in
			gsm)
				audiotool -build -encoding=gsm $base.gsm $voice
				;;
			alaw)
				audiotool -build -encoding=alaw $base.al $voice
				;;
			esac
		done		
	done
done