Say plugin for Take Command / TCC / 4NT
Version 1.1.0 2014-04-23
This plugin provides a quick and intuitive interface to the Windows
text-to-speech feature. The plugin adds two new commands:
SAY, which speaks the text on the command
line or from a text file; and
lists available voices or selects the voice which
SAY will use.
A few utility variables and functions
are also provided.
Windows XP or later is required.
To use this plugin, copy Say.dll to some
known location on your hard drive. (If you are using the 64-bit version of
Take Command, take Say-x64.dll instead of
Say.dll.) Load the plugin with a
PLUGIN /L command. For example:
plugin /l c:\bin\tcmd\test\say.dll
If you copy Say.dll to a subdirectory named PlugIns within your Take Command program directory, the plugin will be loaded automatically by each new instance of TCC.
The syntax definitions in the following text use these conventions for clarity:
|indicates text which must be typed exactly as shown.|
|indicates optional text, which may be typed as shown or omitted.|
|Bold italic||names a required argument; a value must be supplied.|
|Regular italic||names an optional argument.|
|ellipsis…||after an argument means that more than one may be given.|
/A /D /H /K /L /N /X text…
|speak command-line text Asynchronously|
|Disable SAPI XML tags in text (default)|
|speak Help text|
|restart voice; cancel any asynchronous speech|
|Line breaks in text files are significant|
|speak line Numbers in text files|
|enable SAPI XML tags in text|
Put options before any text or filenames. Text and files will be read
in the same order they are listed on the command line. Text can also be
piped or redirected into
SAY; redirected input will be read
after any text or files specified on the command line.
SAY is reading text from a file, you can abort by
pressing Ctrl-C or Ctrl-Break. Be patient; it may be several seconds until
the key is recognized.
SAY will not return until all text has been read.
You can use
/A to speak text from the command line asynchronously
and return immediately. Note that this option only affects text on the
command line; it has no effect on text read from a file, redirection or a
pipe. You can cancel the speech with
SAY is intended primarily for “readable” English
text — sentences and paragraphs. Most line breaks in text files
will be ignored. If you want to use
SAY to read a line-oriented
text file (piped output from a command, for example) you can use
to indicate that line breaks are significant. When
SAY will pause to “take a breath” (and
check for Ctrl-C) at the end of each line.
/N causes the program to speak a “line number”
before each line of text. These line numbers do not correspond to the visual
arrangement of text in the input file or stream. They are, rather, a running
count of the lines of text passed to the Windows speech engine. They might be
better called “sentence numbers” or “utterance numbers”
if those phrases weren’t so clumsy.
/N only apply to text read from
a file, redirection, or a pipe. They don’t affect text specified on
the command line. Options
/D only affect
text and filenames which follow them on the command line.
@file syntax does not
CLIP: device. To read text from the clipboard,
you can use input redirection:
say < clip:
• Note: If
you want to pipe text into
SAY, remember that piping creates a
new shell. If the plugin is not loaded in the new shell, you’ll get
an “Unknown command” error. To prevent this, you can:
- copy the .DLL file into your PlugIns directory, so it’s automatically loaded by the right-hand shell.
- use an in-process pipe (TCC only).
- redirect to and from a temporary file, instead of using a pipe. Remember to delete the temp file when you’re done with it.
/A /D /H name
|read the list Aloud|
|select the system Default voice|
|speak the Help text|
If you do not give a voice name or
VOICE will list all available voices. The
name must follow any options on the command
If name contains wildcards, the first matching
voice found will be selected. Alternatively, name
can be a zero-based index number, as reported by
VOICE only affects this plugin’s
command. It does not change the system default or affect any other program.
|n||integer index from 0 to |
This function will return
-1 if n
is too high.
This variable will return
-1 if an error occurs.
This variable will return
(unknown) if an error occurs.
|1.0.1||2011-02-25||fixed return codes|
|1.0.3||2011-04-12||fixed a problem with |
|1.0.4||2011-04-21||bug fix: plugin name not displayed on error opening @file list|
|1.0.5||2011-04-21||minor improvement to sentence detection in @files; release file handle on ^C|
|1.0.6||2011-04-28||tweaks to sentence detection, handling of pilcrows and section marks|
|1.0.7||2011-11-28||better handling of UTF-8 text files; now command-line text is ground through the same parser as text from files or stdin|
|1.0.8||2013-04-23||updated to Visual Studio 2010; updated the plugin’s web address|
This plugin is Copyright © 2014, Charles Dye. Unaltered copies of the binary and documentation files may be freely distributed without restriction. I make no guarantee and give no warranty for its operation. Use it at your own risk. If you find a problem, you can report it in the JP Software support forum.