Results 1 to 6 of 6
  1.    #1  
    Here's a simple script that could be used as a subroutine to announce many things using a crude, but fully functional, and FREE, voice synthesis application -- FLite.exe. I'm thinking of things like:

    The weather.
    Flight status.
    Missed Calls.
    VoiceMail status.
    General Status of anything ("your alarm is set for 6:00 am, my leige")
    E-Mail text.
    Text Message text.

    The possibilities are endless.

    To use the app, first obtain the FLITE.EXE program from:

    http://www.viksoe.dk/code/flite.htm

    Then install it. This is a 2.5 Meg exe file. Suggest the Storage Card.

    I installed mine at:
    "\Storage Card\Program Files\Flite\"

    Copy the file "SayThis.txt" to the same dir as the FLITE.EXE program.

    If you installed FLITE.EXE and SayThis.txt to the same dir as suggested, run the SayIt script "as is". If u put the flite and/or saythis.txt file somewhere else, edit the script paths as appropriate.

    To use effectively, the SayThis.txt file text would be replaced with whatever text that you want repeated, announced, etc.

    Comments Welcome. Just don't hijak the code and call it your own.

    -- JDC

    Code:
    # SayIt.mscr  [4.17.2007]
    ThisScriptVer = "Ver 0.a"
    # 
    # Read and Say text in file: "SayThis.txt"
    # Requires Flite.exe speech synthesis software for PPC.
    # Flite is available at http://www.viksoe.dk/code/flite.htm
    # 
    #
    # Platform(s):	PPC
    #
    # PPC Tested:	Palm Treo 700w, Windows Mobile V5.1.195 Bld 14929.2.2.1
    #
    # MortScript Ver:	4.0
    #
    # Author: jdcochran@hotmail.com
    #
    # Requires	Flite.exe
    #		SayThis.txt
    # 
    # ----------------------------------------------------------------
    # Release Note(s):
    # ----------------------------------------------------------------
    # To effectively use this program, update text in the file assigned 
    # to the SayThisFile variable and then run the SayIt script.
    #
    # ----------------------------------------------------------------
    
    Platform  = MortScriptType()
    ThisScriptPath = SystemPath("ScriptPath")
    ThisScriptName = SystemPath("ScriptName") & SystemPath("ScriptExt")
    LastScriptCommand = ThisScriptPath &"\" & "Again.mscr"
    MortExe = SystemPath("ScriptExe") \ "MortScript.exe"
    MortVer = FileVersion( MortExe )
    
    Call CheckPlatform
    Call SaveLastCommand
    
    VoiceApp = "\Storage Card\Program Files\Flite\Flite.exe"
    VoiceAppWinName = "Flite"
    SayThisFile = "\Storage Card\Program Files\Flite\SayThis.txt"
    
    
    SleepMessage (2, "Executing " & ThisScriptName &" " & ThisScriptVer &"...")
    
    # --------------------
    # for short messages
    #TextToSay = ReadFile(SayThisFile)
    # --------------------
    Run (SayThisFile)
    Sleep (2000)
    TextWindowName = ActiveWindow()
    SendCtrlKey(TextWindowName, "a" )
    SendCtrlKey(TextWindowName, "c" )
    AppActive = WndExists( VoiceAppWinName )
    Close (TextWindowName)
    
    If (AppActive)
    	Show (VoiceAppWinName)
    Else
    	run (VoiceApp)
    EndIf
    
    WaitForActive (VoiceAppWinName, 10)
    MouseClick (30,220)
    Sleep (500)
    MouseClick (100,100)
    Sleep (500)
    # --------------------
    # for short messages
    #SendKeys (TextToSay)
    #---------------------
    SendCtrlKey(VoiceAppWinName, "v" )
    Sleep (500)
    MouseClick (90, 220)
    
    
    Sub CheckPlatform
    	If (Platform ne "PC" and Platform ne "PPC")
    		Message ("This App was created for PC and/or PocketPC... script will abort.", ThisScriptName)
    		XcastMode = ""
    		Exit
    	EndIf
    EndSub
    
    Sub SaveLastCommand
    	WriteLine = "CallScript (""" &ThisScriptPath &"\" &ThisScriptName & """)"
    	WriteFile (LastScriptCommand, WriteLine)
    EndSub
    Attached Files Attached Files
    Last edited by jdcochran; 04/18/2007 at 12:11 AM.
  2. #2  
    lol, that voice is funny.
    Nice work JD!

    Next step is to get it to run sans ui. Have you looked into the source to see if you can specify the text file to read via a parameter?

    Edit: I took a look at the source and it currently doesn't support commandline parameters, but it could be added. When I get some time I'll give it a shot, but I won't be offended if someone else beats me to it.
    Last edited by hannip; 04/18/2007 at 08:23 AM.
  3. #3  
    In theory it does, but Ive never managed to get it to work (but I might just be doing it wrong). I suspect however it would just be better to recompile the whole thing all over again.

    Surur
  4. #4  
    hmm, just thinking outloud. Voice Command can read appointments and announce callers etc. Has anyone tried to figure out how to pipe text to it?

    Well with VC 1.6 you could send yourself a text message and have VC read its contents. I wonder if there is some trick we could do with 1.5 like set up an appointment in one minute with the contents of what we want it to say.

    It's amazing to me that text to speech from a file is not supported by VC. It has everything it needs to do the speech already.
    Last edited by hannip; 04/18/2007 at 04:44 PM.
  5.    #5  
    Quote Originally Posted by hannip View Post
    lol, that voice is funny.
    Nice work JD!

    Next step is to get it to run sans ui. Have you looked into the source to see if you can specify the text file to read via a parameter?

    Edit: I took a look at the source and it currently doesn't support commandline parameters, but it could be added. When I get some time I'll give it a shot, but I won't be offended if someone else beats me to it.
    I am just a neophyte when it comes to C code, so I would be little help there with the FLITE code.

    However, Voicecmd.exe does support at least one command line parameter, unless the "-min" parameter in the .lnk file is not considered a command-line param.

    I did look at the VoiceCmdRes_PPC.dll in a resource hacker and saw all the possible "canned" responses. There are lots of them (see attached)

    I spent an hour researching this and gave up. I suppose we'll have to wait for 1.6x or higher to work on the Treo. I think it'll support reading a file? Won't it?

    -- JDC
    Attached Images Attached Images
    Last edited by jdcochran; 04/18/2007 at 11:31 PM.
  6.    #6  
    From the FLITE Ver 1.3 Source Readme file:

    Usage:
    ------

    If it compiles properly a binary will be put in bin/, note by
    default -g is on so it will be bigger than is actually required

    ./bin/flite "Flite is a small fast run-time synthesis engine" flite.wav

    Will produce an 8KHz riff headered waveform file (riff is Microsoft's
    wave format often called .WAV).

    ./bin/flite doc/alice

    Will play the text file doc/alice. If the first argument contains
    a space it is treated as text otherwise it is treated as a filename.
    If a second argument is given a waveform file is written to it,
    if no argument is given or "play" is given it will attempt to
    write directly to the audio device (if supported). if "none"
    is given the audio is simply thrown away (used for benchmarking).
    Explicit options are also available.

    ./bin/flite -v doc/alice none

    Will synthesize the file without playing the audio and give a summary
    of the speed.

    ./bin/flite doc/alice alice.wav

    will synthesize the whole of alice into a single file (previoous
    versions would only give the last utterance in the file, but
    that is fixed now).

    An additional set of feature setting options are available, these are
    *debug* options, Voices are represented as sets of feature values (see
    lang/cmu_us_kal/cmu_us_kal.c) and you can override values on the
    command line. This can stop flite from working if malicious values
    are set and therefor this facility is not intended to be made
    available for standard users. But these are useful for
    debugging. Some typical examples are

    ./bin/flite --sets join_type=simple_join doc/intro
    Use simple concatenation of diphones without prosodic modification
    ./bin/flite --seti verbosity=1 doc/alice
    Print sentences as ther are said
    ./bin/flite --setf duration_stretch=1.5 doc/alice
    Make it speak slower
    ./bin/flite --setf int_f0_target_mean=145 doc/alice
    Make it speak higher

    The talking clock is an example talking clode as discussed on
    http://festvox.org/ldom it requires a single argument HH:MM
    under Unix you can call it
    ./bin/flite_time `date +%H:%M`

Posting Permissions