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