sayit.tcl 790 Bytes
#
# Copyright (C) 1996-1998 by the Board of Trustees
#    of Leland Stanford Junior University.
# 
# This file is part of the SimOS distribution. 
# See LICENSE file for terms of the license. 
#


set string ""

set alpha [split " .1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM\n" ""]

foreach ch $alpha {
    expect "*$ch" "newchar \"$ch\""
}

expect {SimOS (1)\# } {
    play /morse/m1/simos/sounds/thx.wav
    speak "The audience is listening"
}

expect {SimOS (*)\# } {
    speak "Prompt ready"
    set string ""
}


proc newchar {ch} {
    global string

#console "in newchar with $ch\n"
    if {$ch == "\n"} {
        if {$string != ""} {
            speak [string tolower $string]
        }
        set string ""
    } else {
        set string "$string$ch"
    }
}