0
0
mirror of https://github.com/python/cpython.git synced 2024-11-29 00:56:12 +01:00
cpython/Doc/mac/libmacspeech.tex

88 lines
2.6 KiB
TeX
Raw Normal View History

\section{Built-in Module \sectcode{macspeech}}
\label{module-macspeech}
1995-02-28 16:46:09 +01:00
\bimodindex{macspeech}
\setindexsubitem{(in module macspeech)}
1995-02-28 16:46:09 +01:00
This module provides an interface to the Macintosh Speech Manager,
1995-03-13 11:03:32 +01:00
allowing you to let the Macintosh utter phrases. You need a version of
1995-02-28 16:46:09 +01:00
the speech manager extension (version 1 and 2 have been tested) in
your \code{Extensions} folder for this to work. The module does not
1995-04-10 13:34:00 +02: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 16:46:09 +01:00
\begin{funcdesc}{Available}{}
Test availability of the Speech Manager extension (and, on the
1995-03-13 11:03:32 +01:00
PowerPC, the Speech Manager shared library). Return 0 or 1.
1995-02-28 16:46:09 +01:00
\end{funcdesc}
\begin{funcdesc}{Version}{}
1995-03-13 11:03:32 +01:00
Return the (integer) version number of the Speech Manager.
1995-02-28 16:46:09 +01: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
prior \code{SpeakString} invocations.
\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}
Return a voice object for voice number \var{num}.
\end{funcdesc}
\subsection{voice objects}
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 16:46:09 +01:00
\begin{funcdesc}{GetGender}{}
1997-11-25 02:00:40 +01:00
Return the gender of the voice: 0 for male, 1 for female and -1 for neuter.
1995-02-28 16:46:09 +01:00
\end{funcdesc}
\begin{funcdesc}{NewChannel}{}
Return a new speech channel object using this voice.
\end{funcdesc}
\subsection{speech channel objects}
A speech channel object allows you to speak strings with slightly more
control than \code{SpeakString()}, and allows you to use multiple
speakers at the same time. Please note that channel pitch and rate are
1995-03-13 11:03:32 +01:00
interrelated in some way, so that to make your Macintosh sing you will
1995-02-28 16:46:09 +01:00
have to adjust both.
\setindexsubitem{(speech channel object method)}
1995-02-28 16:46:09 +01:00
\begin{funcdesc}{SpeakText}{str}
Start uttering the given string.
\end{funcdesc}
\begin{funcdesc}{Stop}{}
Stop babbling.
\end{funcdesc}
\begin{funcdesc}{GetPitch}{}
1995-03-13 11:03:32 +01:00
Return the current pitch of the channel, as a floating-point number.
1995-02-28 16:46:09 +01:00
\end{funcdesc}
\begin{funcdesc}{SetPitch}{pitch}
Set the pitch of the channel.
\end{funcdesc}
\begin{funcdesc}{GetRate}{}
Get the speech rate (utterances per minute) of the channel as a
floating point number.
\end{funcdesc}
\begin{funcdesc}{SetRate}{rate}
Set the speech rate of the channel.
\end{funcdesc}