Register
It is currently Mon Dec 22, 2014 7:03 am

Using Festival with bash to say things.


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Thu Dec 29, 2005 4:33 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 673
Location: Des Moines, Iowa
Code:
#!/bin/bash
mainmenu ()
{
clear; echo "Temp Conversion Script";echo ""; menu="\t1) \tFahrenheit to Celsius Conversion\n\t2)\tCelsius to Fahrenheit Conversion\n\t0)\tExit";
echo -e "$menu";echo "";read -p "Please choose one of the options above : " option
while true; do
   case $option in
      1)   F2C;
         ;;
      2)   C2F;
         ;;
      0)   option="";
         exit;
         ;;
      *)   echo "That choice was invalid!!";
         ;;
   esac
done
}
F2C ()
{
echo "Fahrenheit to Celsius Conversion";echo "Enter the temperature (in Fahrenheit):";read FT
tconv=`echo "($FT - 32) * 5 / 9 " |bc`
echo -en "The Temperature in Celsius is ";echo "$tconv" ;
echo -en "$FT degrees Fahrenheit is the same as $tconv degrees Celsius" > temperature.txt
festival --tts  temperature.txt
rm  temperature.txt
read -p "Hit RETURN to continue" temp;
mainmenu
}
C2F ()
{
echo "Celsius to Fahrenheit Conversion";echo "Enter the temperature (in Celsius):";read CT
tconv=`echo "$CT * 9 / 5 + 32 " |bc`
echo -en "The Temperature in Fahrenheit is ";echo "$tconv";
echo -en "$CT degrees Celsius is the same as $tconv degrees Fahrenheit" > temperature.txt
festival --tts  temperature.txt
rm  temperature.txt
read -p "Hit RETURN to continue" temp;
mainmenu
}
mainmenu
exit


Top
 Profile WWW  
 PostPosted: Tue Jan 03, 2006 2:16 am   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 673
Location: Des Moines, Iowa
On my mandriva system...... i had to do the following.........

Code:
    Create the file /usr/share/festival/lib/siteinit.scm   (if you don’t already have it) and add the following

    (Parameter.set 'Audio_Method 'Audio_Command)
    (Parameter.set ‘Audio_Command “sox -t raw -sw -r $SR $FILE -c2 -t ossdsp /dev/dspâ€￾)


On my mandriva system.......the speech was way too fast..... sounded like a chipmunk on speed or something :lol: :lol: Adding this file fixed that.


Top
 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP