Sox

Aus SchnallIchNet
(Weitergeleitet von Wav2gsm)
Wechseln zu: Navigation, Suche

wav2gsm

konvert WAV to GSM format

#!/bin/bash
#
#

if [ -z "$1" ]; then
        SP="."
else
        SP=$1
fi

for i in $SP/*.wav; do
        sox $i -r 8000 -c 1 ${SP}/$(basename $i .wav).gsm resample -ql
done

wav2mp3

#!/bin/sh                        

if [ -z "$1" ] || [ -z "$2" ]; then
        echo Usage $0 [PATH to src-dir] [PATH to dst-dir]
        exit 1;                                          
fi                                                       

cd $1;
if [ $? -ne 0 ]; then
        echo cd to $1 failed. Check src-path please
        exit 1;
fi

if [ ! -d "$2" ]; then
        echo "dst-dir $2 does not exist!"
        echo -n "Press ENTER to create it."; read hlp;
        mkdir -p "$2"                                 
fi                                                    

for i in ./*.wav; do
        file_orig=`basename "$i" .wav`;
        file=`echo "$file_orig" | tr ' ' '_'`;
        echo $file_orig; echo $file;
        lame -h -b 192 "$i" "$2/${file}.mp3";
done

unset i;

for i in ./*.WAV; do
        file_orig=`basename "$i" .WAV`;
        file=`echo "$file_orig" | tr ' ' '_'`;
        echo $file_orig; echo $file;
        lame -h -b 192 "$i" "$2/${file}.mp3";
done

### EOF ###