File: au2raw

package info (click to toggle)
saydate 0.3.0-9
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 476 kB
  • ctags: 8
  • sloc: sh: 205; makefile: 53
file content (32 lines) | stat: -rwxr-xr-x 785 bytes parent folder | download | duplicates (4)
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
#!/bin/bash
#
#au2raw converts au files to raw files for outputting to /dev/audio
# - requires sox

version="0.0.2"


    case $1 in
    --version) #print the version number
	echo "au2raw version "$version
	exit 1;;
    --help) #Display the help screen
	echo "au2raw [options]"
	echo " file	convert file.au to file.raw"
	echo " -max	convert all .raw files to maximum volume .raw files"
	exit 1;;
    -max)
	for arg in `ls *.raw`
	do
	    echo $arg
	    volume=`sox -t raw -r 8000 -U -b $arg -e stat -v 2>&1`
	    sox -t raw -r 8000 -U -b $arg -v $volume -t raw -r 8000 -U -b - | sox -t raw -r 8000 -U -b - -t raw -r 8000 -U -b $arg
	done
	exit;;
    *)
    	volume=`sox $1.au -e stat -v 2>&1`
	sox $1.au -v $volume -t raw -r 8000 -U -b $1.raw
	cat $1.raw >/dev/audio
	exit;;
    esac