[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Sit! Speak! Good XyWrite!



Here's something different, and fun: A U2 routine that harnesses the
Windows text-to-speech (TTS) facility for use within XyWrite.

With frame SPEAK in U2, you can issue XyWrite commands to hear
spoken playback from any of the following sources:

- Quoted text
- DeFined text
- Text file
- Windows Clipboard
- XyWrite error messages[*]

[*] Enables XPL programs to display and speak error messages, as
follows:
...JM 2.speakQ2 ...

SPEAK uses a tiny Windows command-line utility called NIRCMD
(freeware from NirSoft). Download NIRCMD.ZIP at
http://www.nirsoft.net/utils/nircmd.html. Unzip the contents
(three files) into the directory that contains Editor.exe. (Only
NIRCMDC.EXE is required for frame SPEAK, but future U2 routines may
require the other files.)

NIRCMD's abilities extend far beyond TTS; to see what else it can
do, read the help page at
http://www.nirsoft.net/utils/nircmd2.html. Lots of possibilities
here for XPLers; write your own routines and share them here.

Frame SPEAK and related documentation are encoded below. In XyWrite,
with U2 installed, command DECODE to decode. Then, 1) paste
the Help screen into XYWWWEB.INF, and 2) DeFine frame SPEAK in its
entirety and issue ADD2U2 to add it to your U2 file.

Enjoy.

XPLeNCODE v2.0
b-gin [UNTITLED]
1) Help screen (copy down to "End of Help screen") and paste{032}
into XYWWWEB.INF):[cr|lf][cr|lf]{speak}[cr|lf][cr|lf]SPEAK -{032}
C.L.Distefano rev.12/5/10[cr|lf]Use the Windows Text-to-Speec
h facility in XyWrite[cr|lf][cr|lf]Required External Software
[cr|lf]--------------------------[cr|lf]NIRCMDC.EXE, freeware
 from NirSoft (www.nirsoft.net), must be located in the direc
tory that contains Editor ({<}VA$ED{>}).[cr|lf]Download NIRCM
D.ZIP at http://www.nirsoft.net/utils/nircmd.html. Unzip th
e contents (three files) into the directory that contains Edi
tor.exe. (Only NIRCMDC.EXE is required for frame SPEAK.)[cr|l
f][cr|lf]Usages[cr|lf]------[cr|lf]Note: Numeric parameters c
an be appended to any argument to adjust playback speed (rang
e = -10 to 10) and volume (0-100) on the fly. For example (se
e Usage 1 below):[cr|lf]SPEAK "Daisy, Daisy" -10 90[
cr|lf][cr|lf]1) Speak quoted text:[cr|lf]SPEAK "blah blah bla
h"[cr|lf](quotes required)[cr|lf][cr|lf]2) Speak DeF
ined text:[cr|lf]With text DeFined:[cr|lf]SPEAK DEF[
cr|lf] or, simply:[cr|lf]SPEAK[cr|lf][cr|lf]3) Speak
 contents of file:[cr|lf]SPEAK FILE ["][d:\path\]filename["][
cr|lf](Long filenames accepted; use quotes if filename contai
ns blank space)[cr|lf](Ctrl-C terminates playback)[cr|lf][cr|
lf]4) Speak contents (text) of Windows Clipboard:[cr|lf]SPEAK
 CLIP[cr|lf](Ctrl-C terminates playback)[cr|lf][cr|l
f]5) Speak (and display) XyWrite error message:[cr|lf]SPEAK E
RR #[cr|lf](where # is the numeric error code return
ed by [≪_]VA$ER[≫_])[cr|lf]XPL (speak and display error mes
sage):[cr|lf][≪_]SX50,[≪_]VA$ER[≫_][≫_][≪_]SX50,"ERR "+[
≪_]IS50[≫_][≫_][JM_]2.speak[Q2_][cr|lf][cr|lf]Additional u
sage information[cr|lf]----------------------------[cr|lf]Fra
me SPEAK works with any input accepted by the NIRCMD.EXE's SP
EAK keyword. For details, read the documentation at:[cr|lf]ht
tp://www.nirsoft.net/utils/nircmd2.html#using[cr|lf][cr|lf][c
r|lf]{<}FC{>}[cr|lf]
For use by RENUMBER.PM[cr|lf]Renumber frame SPEAK in PACK mod
e[cr|lf]Default S/G range = 01-03; 50[cr|lf]OPTIONs (1):[cr|l
f]FREEZE 50[cr|lf]{<}FL{>}[cr|lf]-{tab}-{tab}-{tab}-{tab}-{ta
b}-{tab}-{tab}-{tab}-{tab}-[cr|lf][cr|lf][End of Help screen]
[cr|lf][cr|lf]2) U2 frame (DeFine in its entirety and issue A
DD2U2 ):[cr|lf][cr|lf]{{;5speak}} Use the Windows Te
xt-to-Speech facility in XyWrite (requires NIRCMDC.EXE in Edi
tor's directory) [CLD 12/5/10][cr|lf]{002}[BX_]es 1[Q2_]{<}IF
{<}VA|50{>}<0{>}{<}SV50,{>}{<}EI{>}{<}SX01,{<}IS50{>}{>}{<}SX
50,{<}VA$ED{>}{>}[JM_]2.GetPath[Q2_]{<}SV02,{>}{<}XS01,03,03,
03,02{>}{<}IF"DEF"{238}@upr({<}IS01{>})==0!{<}VA$DF{>}>0&{<}V
A|01{>}<1{>}{<}IF"DEF "{238}@upr({<}IS01{>})==0{>}{<}SV03,F {
{062}}{<}SV02,{>}{<}XS01,03,03,03,02{>}{<}EI{>}[DZ_]{<}IF{<}VA$DE
{>}>0{>}[BX_]sad/nv {<}PV50{>}\$SPEAK$.TMP[Q2_]{<}SX01,"file{032}
"+{<}IS50{>}+"\$SPEAK$.TMP"{>}{<}IF{<}VA|02{>}>0{>}{<}SX01,{<
}IS01{>}+" "+{<}IS02{>}{>}{<}EI{>}{<}LBa{>}[BX_]dos/nv/x/z /c
 {<}PV50{>}\nircmdc.exe speak {<}PV01{>}[Q2_]{<}EX{>}{<}EI{>}
{<}SV01,text "Nothing DeFined!"{>}{<}GLa{>}{<}EI{>}{<}IF{<}VA
|01{>}>0{>}{<}IF""""{238}{<}IS01{>}==0{>}{<}SX01,"text "+{<}I
S01{>}{>}{<}EI{>}{<}IF"CLIP"{238}@upr({<}IS01{>})==0{>}{<}IF@
upr({<}IS01{>}){240}" "{>}{<}SV03, {>}{<}SV02,{>}{<}XS01,03,0
3,03,02{>}{<}EI{>}{<}SX01,"text ~$clipboard$"{>}{<}IF{<}VA|02
{>}>0{>}{<}SX01,{<}IS01{>}+" "+{<}IS02{>}{>}{<}EI{>}{<}GLa{>}
{<}EI{>}{<}IF"ERR"{238}@upr({<}IS01{>})==0{>}{<}IF" "{238}{<}
IS01{>}<0{>}{<}SX03,{<}VA$ER{>}{>}{<}SX03,{<}IS03{>}{>}{<}GLb
{>}{<}EI{>}{<}IF"ERR "{238}@upr({<}IS01{>})==0{>}{<}SV03, {>}
{<}XS01,03,02,03,03{>}{<}SV02,{>}{<}IF{<}IS03{>}{240}" "{>}{<
}SV01, {>}{<}XS03,01,01,02,02{>}{<}SX03,{<}IS01{>}{>}{<}EI{>}
{<}LBb{>}{<}IF{<}VA{021}03{>}>0{>}{<}SX01,"{<}SX03,{<}VA\"+{<
}IS03{>}+"{>}{>}"{>}{<}PV01{>}{<}IF{<}IS03{>}{240}"&"{>}{<}SX
03,{<}VA@03&1{>}+{<}VA$FI{>}{>}{<}EI{>}{<}PR@03{>}{<}SX01,{<}
IS03{>}{>}{<}EI{>}{<}SX01,"text "+""""+{<}IS01{>}+""""{>}{<}I
F{<}VA|02{>}>0{>}{<}SX01,{<}IS01{>}+" "+{<}IS02{>}{>}{<}EI{>}
{<}EI{>}{<}EI{>}{<}GLa{>}{<}EI{>}{<}SV01,text "At the risk of
 sounding impertinent, why don't you read the Help screen fir
st?"{>}{<}GLa{>}{002}[cr|lf][cr|lf]
-nd
XPLeNCODE

--
Carl Distefano
cld@xxxxxxxx