[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Speech extension for DrScheme
I have attached a zip file to this mail message containing source and dlls
for a simple extension to DrScheme and friends. This package provides
fairly primitive access to the text-to-speech capabilities of the Microsoft
Speech API. Here is the doc.txt file, it is also included in the archive.
Anyone is free to use this in any way.
gb
doc.txt --------------------------------------------------------------------
An extension to provide a simple interface to the Microsoft Speech API.
Specifically,
the CSTTTSQueue object.
This can probably be done better! I know almost nothing about MzScheme and
not much
more about the SAPI. Suggestions for improvement will be gladly received. I
tried to
mimic the "style" I saw in some other packages as far as function naming
and such. If
these names violate some rules, let me know.
You'll need the Speech SDK 4.0 to compile and use these. It can be
downloaded from
http://microsoft.com/iit/download/default.htm
Gary Bishop
bishop@cs.unc.edu
======================================
PROCEDURES
> (load-extension "Release/SchemeSpeak.dll") ; running from the project
directory
Loads the extension and initializes the COM stuff. Returns #t to signal
success, #f for
failure.
> (add-voice string)
Adds a text-to-speech engine to the TTSQueue object. The string names
the engine. For
example, (add-voice "Mary") adds the MS TTS engine named Mary to the
queue. You need to
do this before calling speak if you expect to hear anything. You can do
it anytime that
speech is stopped. Returns #t for success, #f for failure. Failure is
likely caused by
either calling it while speech was happening or with the name of an
engine that doesn't
exist.
> (speak string1 string2)
String2 is the text to speak. It should be a complete sentence or
paragraph because
the engine will assume it is a complete sentence and pause at the end.
String1 is the
voice to use. This voice should have been previously added. Returns an
exact integer
sequence number that increases with each call to speak. This function
returns immediately,
the text is queued and spoken ASAP. You can use the sequence number with
functions
described below to determine which text has been or is being spoken.
> (stop-speech)
Interrupts the speech output and clears the queue. Returns an exact
integer that is
the sequence number (see speak) of the last buffer thought to have been
completely
spoken.
> (speaking?)
Returns #t if the engine is currently speaking, #f if not.
> (last-spoken)
Returns the sequence number of the last text that is thought to have
been fully spoken.
> (now-speaking)
Returns the sequence number of the text currently being spoken. #f if
(speaking?) is #f.
> (speech-error-message)
Returns a string that is the last internal error message from the speech
system. You can
query this when a function returns #f to see what happened.
> (speech-speed string [ integer ])
Returns the previous speaking speed in words per minute for the voice
specified by the
string. If the optional integer is supplied, it sets the new speech speed.
> (speech-pitch string [ integer ])
Returns the baseline speech pitch in Hertz. If the optional integer is
supplied it sets the
new baseline pitch.
> (speech-volume string [ integer ])
Returns the baseline speaking volume (0==silent, 65535=full volume). If
the optional integer
is supplied sets the new baseline volume.
ship.zip