Comments

Flat
recording script
User: AtnNn
Date: 5/18/2008 6:20 pm
Views: 2687
Rating: 16

Linux users who have arecord and aplay can use this script:

 

#!/bin/bash

prompts=$1
dest=$2

if [ ! -f "$prompts" ]; then
    echo usage $0 '<prompts>' [folder]

fi

if [ "a$dest" = a ]; then
    dest=.
else
    dest=${dest%/}
fi

echo Please press ^C after reading each prompt
echo -n Press enter to start' '
read

while read line <&3; do
    line=${line#\*/}
    name=${line%% *}
    prompt=${line#* }
    file="$dest/$name.wav"

    if test -f "$file"; then
        echo [$file]
        echo '=>' $prompt
        aplay -q $file &
        aplay=$!
        echo -n "File $file exists, redo [yN]? "
        read a
        kill $aplay 2>&1
        if [ "a$a" != ay ]; then continue; fi
    fi

    while true; do
        echo [$file]
        echo '=>' $prompt
        arecord -q -f dat $file
        aplay -q $file &
        aplay=$!
        echo -n 'next, redo or quit [Nrq]? '
        read a
        kill $aplay 2>&1
        if [ "a$a" = aq ]; then exit; fi
        if [ "a$a" = ar ]; then continue; fi
        break
    done
done 3< $prompts

Re: recording script
User: kmaclean
Date: 5/19/2008 8:26 pm
Views: 197
Rating: 19

Hi AtnNn,

Thanks, this is great script - it works really well!

Ken 

 

Previous