blob: fc35520b64581e2c66a152c4a17d254b3481316e [file] [log] [blame]
Guido van Rossum470be141995-03-17 16:07:09 +00001\section{Built-in Module \sectcode{macspeech}}
Jack Jansene4be9be1995-02-28 15:46:09 +00002\bimodindex{macspeech}
3
Guido van Rossum86751151995-02-28 17:14:32 +00004\renewcommand{\indexsubitem}{(in module macspeech)}
5
Jack Jansene4be9be1995-02-28 15:46:09 +00006This module provides an interface to the Macintosh Speech Manager,
Guido van Rossum6bb1adc1995-03-13 10:03:32 +00007allowing you to let the Macintosh utter phrases. You need a version of
Jack Jansene4be9be1995-02-28 15:46:09 +00008the speech manager extension (version 1 and 2 have been tested) in
9your \code{Extensions} folder for this to work. The module does not
Guido van Rossum96628a91995-04-10 11:34:00 +000010provide full access to all features of the Speech Manager yet. It may
11not be available in all Mac Python versions.
Jack Jansene4be9be1995-02-28 15:46:09 +000012
13\begin{funcdesc}{Available}{}
14Test availability of the Speech Manager extension (and, on the
Guido van Rossum6bb1adc1995-03-13 10:03:32 +000015PowerPC, the Speech Manager shared library). Return 0 or 1.
Jack Jansene4be9be1995-02-28 15:46:09 +000016\end{funcdesc}
17
18\begin{funcdesc}{Version}{}
Guido van Rossum6bb1adc1995-03-13 10:03:32 +000019Return the (integer) version number of the Speech Manager.
Jack Jansene4be9be1995-02-28 15:46:09 +000020\end{funcdesc}
21
22\begin{funcdesc}{SpeakString}{str}
23Utter the string \var{str} using the default voice,
24asynchronously. This aborts any speech that may still be active from
25prior \code{SpeakString} invocations.
26\end{funcdesc}
27
28\begin{funcdesc}{Busy}{}
29Return the number of speech channels busy, system-wide.
30\end{funcdesc}
31
32\begin{funcdesc}{CountVoices}{}
33Return the number of different voices available.
34\end{funcdesc}
35
36\begin{funcdesc}{GetIndVoice}{num}
37Return a voice object for voice number \var{num}.
38\end{funcdesc}
39
40\subsection{voice objects}
41Voice objects contain the description of a voice. It is currently not
42yet possible to access the parameters of a voice.
43
44\renewcommand{\indexsubitem}{(voice object method)}
45
46\begin{funcdesc}{GetGender}{}
Guido van Rossum6bb1adc1995-03-13 10:03:32 +000047Return the gender of the voice:\ 0 for male, 1 for female and $-1$ for neuter.
Jack Jansene4be9be1995-02-28 15:46:09 +000048\end{funcdesc}
49
50\begin{funcdesc}{NewChannel}{}
51Return a new speech channel object using this voice.
52\end{funcdesc}
53
54\subsection{speech channel objects}
55A speech channel object allows you to speak strings with slightly more
56control than \code{SpeakString()}, and allows you to use multiple
57speakers at the same time. Please note that channel pitch and rate are
Guido van Rossum6bb1adc1995-03-13 10:03:32 +000058interrelated in some way, so that to make your Macintosh sing you will
Jack Jansene4be9be1995-02-28 15:46:09 +000059have to adjust both.
60
61\renewcommand{\indexsubitem}{(speech channel object method)}
62\begin{funcdesc}{SpeakText}{str}
63Start uttering the given string.
64\end{funcdesc}
65
66\begin{funcdesc}{Stop}{}
67Stop babbling.
68\end{funcdesc}
69
70\begin{funcdesc}{GetPitch}{}
Guido van Rossum6bb1adc1995-03-13 10:03:32 +000071Return the current pitch of the channel, as a floating-point number.
Jack Jansene4be9be1995-02-28 15:46:09 +000072\end{funcdesc}
73
74\begin{funcdesc}{SetPitch}{pitch}
75Set the pitch of the channel.
76\end{funcdesc}
77
78\begin{funcdesc}{GetRate}{}
79Get the speech rate (utterances per minute) of the channel as a
80floating point number.
81\end{funcdesc}
82
83\begin{funcdesc}{SetRate}{rate}
84Set the speech rate of the channel.
85\end{funcdesc}
86