Added bin/wav2alaw
Signed-off-by: Jacob Kiers <jacob@alphacomm.nl>
This commit is contained in:
parent
3d9e4513a3
commit
bfa37857c6
26
bin/wav2alaw
Executable file
26
bin/wav2alaw
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Converts all wav-files in a directory to alaw.
|
||||
|
||||
if [[ -z "$1" ]]; then
|
||||
DIR='.'
|
||||
else
|
||||
if [ ! -d "$1" ]; then
|
||||
echo "Directory does not exist!"
|
||||
exit
|
||||
else
|
||||
DIR=$1
|
||||
fi
|
||||
fi
|
||||
|
||||
cd $DIR
|
||||
for f in `ls -1 *.wav | sed 's/\.[^.]*$//' | sort -n`; do
|
||||
echo "Converting $f.wav to $f.alaw..."
|
||||
`sox $f.wav --channels 1 --encoding a-law --rate 8000 --type raw $f.alaw.wav`
|
||||
if [ $? -eq 0 ]; then
|
||||
`mv $f.alaw.wav $f.alaw`
|
||||
`rm $f.wav`
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Done."
|
Loading…
Reference in New Issue
Block a user