@ This script demonstrates the basic capabilities of kspeak.
@ Let's turn on command echo so all commands are shown.
@ set echo on
set echo on
@
@ Display the D-Bus replies that KTTSD returns.
@
set replies on
@
@ Display the D-Bus signals that KTTSD sends.
@
set signals on
@
@ Speak something.
@
say "Hello.  This is the k speak utility speaking." 0
@
@ Pause 3 seconds.
@
@ pause 3000
@
pause 3000
@
@ Turn replies and signals displays off.
@
set replies off
set signals off
@
@ Fill a buffer with multiple lines of text.
@
bufferbegin
The quality of mercy is not strained.
It droppeth as the gentle rain from heaven.
Upon the place beneath. It is twice blest.
It blesseth him that gives and him that takes.
bufferend
@
@ Set a timeout for WAITs of 20 seconds.
@
set wtimeout 20000
@
@ Turn command echo off.
@
set echo off
@
@ Send the buffer to KTTSD.
@ jn = say "$(_BUF)" 0
@
jn = say "$(_BUF)" 0
@
@ Wait for KTTSD to signal that the job has finished (state = 6).
@ Here we use the built-in variable _APPID for the AppID of kspeak.
@
@ wait jobStateChanged $(_APPID) $(jn) 6
@
wait jobStateChanged $(_APPID) $(jn) 6
@
@ Send the buffer to KTTSD again, wait for the second
@ sentence to be spoken, (markerType = 1),
@ then cancel the job by deleting it.
@
@ jn = say "$(_BUF)" 0
@ wait marker $(_APPID) $(jn) 1 2
@ removeJob $(jn)
@
jn = say "$(_BUF)" 0
wait marker $(_APPID) $(jn) 1 2
removeJob $(jn)
@
@ End of test.
@
@ quit
@
quit
