1 @ This script demonstrates the basic capabilities of kspeak.
2 @ Let's turn on command echo so all commands are shown.
6 @ Display the D-Bus replies that KTTSD returns.
10 @ Display the D-Bus signals that KTTSD sends.
16 say "Hello. This is the k speak utility speaking." 0
24 @ Turn replies and signals displays off.
29 @ Fill a buffer with multiple lines of text.
32 The quality of mercy is not strained.
33 It droppeth as the gentle rain from heaven.
34 Upon the place beneath. It is twice blest.
35 It blesseth him that gives and him that takes.
38 @ Set a timeout for WAITs of 20 seconds.
42 @ Turn command echo off.
46 @ Send the buffer to KTTSD.
47 @ jn = say "$(_BUF)" 0
51 @ Wait for KTTSD to signal that the job has finished (state = 6).
52 @ Here we use the built-in variable _APPID for the AppID of kspeak.
54 @ wait jobStateChanged $(_APPID) $(jn) 6
56 wait jobStateChanged $(_APPID) $(jn) 6
58 @ Send the buffer to KTTSD again, wait for the second
59 @ sentence to be spoken, (markerType = 1),
60 @ then cancel the job by deleting it.
62 @ jn = say "$(_BUF)" 0
63 @ wait marker $(_APPID) $(jn) 1 2
67 wait marker $(_APPID) $(jn) 1 2