cpython/Doc/mac/libmacspeech.tex

97 lines
2.9 KiB
TeX
Raw Normal View History

1998-08-10 15:40:22 -03:00
\section{\module{macspeech} ---
Interface to the Macintosh Speech Manager.}
\declaremodule{builtin}{macspeech}
\modulesynopsis{Interface to the Macintosh Speech Manager.}
1995-02-28 11:46:09 -04:00
1995-02-28 11:46:09 -04:00
This module provides an interface to the Macintosh Speech Manager,
1998-04-04 02:23:02 -04:00
\index{Macintosh Speech Manager}
\index{Speech Manager, Macintosh}
1995-03-13 06:03:32 -04:00
allowing you to let the Macintosh utter phrases. You need a version of
1998-04-04 02:23:02 -04:00
the Speech Manager extension (version 1 and 2 have been tested) in
your \file{Extensions} folder for this to work. The module does not
1995-04-10 08:34:00 -03:00
provide full access to all features of the Speech Manager yet. It may
not be available in all Mac Python versions.
1995-02-28 11:46:09 -04:00
\begin{funcdesc}{Available}{}
Test availability of the Speech Manager extension (and, on the
1998-04-04 02:23:02 -04:00
PowerPC, the Speech Manager shared library). Return \code{0} or
\code{1}.
1995-02-28 11:46:09 -04:00
\end{funcdesc}
\begin{funcdesc}{Version}{}
1995-03-13 06:03:32 -04:00
Return the (integer) version number of the Speech Manager.
1995-02-28 11:46:09 -04:00
\end{funcdesc}
\begin{funcdesc}{SpeakString}{str}
Utter the string \var{str} using the default voice,
asynchronously. This aborts any speech that may still be active from
1998-04-04 02:23:02 -04:00
prior \function{SpeakString()} invocations.
1995-02-28 11:46:09 -04:00
\end{funcdesc}
\begin{funcdesc}{Busy}{}
Return the number of speech channels busy, system-wide.
\end{funcdesc}
\begin{funcdesc}{CountVoices}{}
Return the number of different voices available.
\end{funcdesc}
\begin{funcdesc}{GetIndVoice}{num}
1998-04-04 02:23:02 -04:00
Return a \pytype{Voice} object for voice number \var{num}.
1995-02-28 11:46:09 -04:00
\end{funcdesc}
1998-04-04 02:23:02 -04:00
\subsection{Voice Objects}
\label{voice-objects}
1995-02-28 11:46:09 -04:00
Voice objects contain the description of a voice. It is currently not
yet possible to access the parameters of a voice.
\setindexsubitem{(voice object method)}
1995-02-28 11:46:09 -04:00
1998-04-04 02:23:02 -04:00
\begin{methoddesc}[Voice]{GetGender}{}
Return the gender of the voice: \code{0} for male, \code{1} for female
and \code{-1} for neuter.
\end{methoddesc}
1995-02-28 11:46:09 -04:00
1998-04-04 02:23:02 -04:00
\begin{methoddesc}[Voice]{NewChannel}{}
Return a new Speech Channel object using this voice.
\end{methoddesc}
1995-02-28 11:46:09 -04:00
1998-04-04 02:23:02 -04:00
\subsection{Speech Channel Objects}
\label{speech-channel-objects}
A Speech Channel object allows you to speak strings with slightly more
control than \function{SpeakString()}, and allows you to use multiple
1995-02-28 11:46:09 -04:00
speakers at the same time. Please note that channel pitch and rate are
1995-03-13 06:03:32 -04:00
interrelated in some way, so that to make your Macintosh sing you will
1995-02-28 11:46:09 -04:00
have to adjust both.
1998-04-04 02:23:02 -04:00
\begin{methoddesc}[Speech Channel]{SpeakText}{str}
1995-02-28 11:46:09 -04:00
Start uttering the given string.
1998-04-04 02:23:02 -04:00
\end{methoddesc}
1995-02-28 11:46:09 -04:00
1998-04-04 02:23:02 -04:00
\begin{methoddesc}[Speech Channel]{Stop}{}
1995-02-28 11:46:09 -04:00
Stop babbling.
1998-04-04 02:23:02 -04:00
\end{methoddesc}
1995-02-28 11:46:09 -04:00
1998-04-04 02:23:02 -04:00
\begin{methoddesc}[Speech Channel]{GetPitch}{}
1995-03-13 06:03:32 -04:00
Return the current pitch of the channel, as a floating-point number.
1998-04-04 02:23:02 -04:00
\end{methoddesc}
1995-02-28 11:46:09 -04:00
1998-04-04 02:23:02 -04:00
\begin{methoddesc}[Speech Channel]{SetPitch}{pitch}
1995-02-28 11:46:09 -04:00
Set the pitch of the channel.
1998-04-04 02:23:02 -04:00
\end{methoddesc}
1995-02-28 11:46:09 -04:00
1998-04-04 02:23:02 -04:00
\begin{methoddesc}[Speech Channel]{GetRate}{}
1995-02-28 11:46:09 -04:00
Get the speech rate (utterances per minute) of the channel as a
floating point number.
1998-04-04 02:23:02 -04:00
\end{methoddesc}
1995-02-28 11:46:09 -04:00
1998-04-04 02:23:02 -04:00
\begin{methoddesc}[Speech Channel]{SetRate}{rate}
1995-02-28 11:46:09 -04:00
Set the speech rate of the channel.
1998-04-04 02:23:02 -04:00
\end{methoddesc}
1995-02-28 11:46:09 -04:00