sayit.tcl
790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#
# 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"
}
}