File: normalize.sh

package info (click to toggle)
edgar 1.37-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 227,860 kB
  • sloc: ansic: 93,832; sh: 388; makefile: 185; xml: 88
file content (23 lines) | stat: -rwxr-xr-x 322 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
#!/bin/bash
files=""
for i in `find . -name *.wav`;do
	encode=0
	none=${i%.*}
	
	if [ ! -f $none ]; then
		encode=1
	else
		wavAge=`stat -c %Y $i`
		oggAge=`stat -c %Y $none`
		
		if [ $oggAge -lt $wavAge ]; then
			encode=1
		fi
	fi
	
	if [ $encode = 1 ]; then
		oggenc -q 4 $i
		ogg=${none}.ogg
		mv $ogg $none
	fi
done