blob: 20221788aa792313c1d076d707b3096a29eaa79d [file] [log] [blame]
Fred Drakec817e271998-08-10 18:40:22 +00001\section{\module{macspeech} ---
Fred Drakef6863c11999-03-02 16:37:17 +00002 Interface to the Macintosh Speech Manager}
3
Fred Drakefe7f3bc1998-07-23 17:55:31 +00004\declaremodule{builtin}{macspeech}
Fred Drakef6863c11999-03-02 16:37:17 +00005 \platform{Mac}
Fred Drakefe7f3bc1998-07-23 17:55:31 +00006\modulesynopsis{Interface to the Macintosh Speech Manager.}
7
Jack Jansene4be9be1995-02-28 15:46:09 +00008
Jack Jansene4be9be1995-02-28 15:46:09 +00009This module provides an interface to the Macintosh Speech Manager,
Fred Drake41788db1998-04-04 06:23:02 +000010\index{Macintosh Speech Manager}
11\index{Speech Manager, Macintosh}
Guido van Rossum6bb1adc1995-03-13 10:03:32 +000012allowing you to let the Macintosh utter phrases. You need a version of
Fred Drake41788db1998-04-04 06:23:02 +000013the Speech Manager extension (version 1 and 2 have been tested) in
14your \file{Extensions} folder for this to work. The module does not
Jack Jansen827713a2001-09-11 20:18:04 +000015provide full access to all features of the Speech Manager.
16
17This module is only available on MacOS9 and earlier in classic PPC
18MacPython.
Jack Jansene4be9be1995-02-28 15:46:09 +000019
20\begin{funcdesc}{Available}{}
21Test availability of the Speech Manager extension (and, on the
Fred Drake41788db1998-04-04 06:23:02 +000022PowerPC, the Speech Manager shared library). Return \code{0} or
23\code{1}.
Jack Jansene4be9be1995-02-28 15:46:09 +000024\end{funcdesc}
25
26\begin{funcdesc}{Version}{}
Guido van Rossum6bb1adc1995-03-13 10:03:32 +000027Return the (integer) version number of the Speech Manager.
Jack Jansene4be9be1995-02-28 15:46:09 +000028\end{funcdesc}
29
30\begin{funcdesc}{SpeakString}{str}
31Utter the string \var{str} using the default voice,
32asynchronously. This aborts any speech that may still be active from
Fred Drake41788db1998-04-04 06:23:02 +000033prior \function{SpeakString()} invocations.
Jack Jansene4be9be1995-02-28 15:46:09 +000034\end{funcdesc}
35
36\begin{funcdesc}{Busy}{}
37Return the number of speech channels busy, system-wide.
38\end{funcdesc}
39
40\begin{funcdesc}{CountVoices}{}
41Return the number of different voices available.
42\end{funcdesc}
43
44\begin{funcdesc}{GetIndVoice}{num}
Fred Drake41788db1998-04-04 06:23:02 +000045Return a \pytype{Voice} object for voice number \var{num}.
Jack Jansene4be9be1995-02-28 15:46:09 +000046\end{funcdesc}
47
Fred Drake41788db1998-04-04 06:23:02 +000048\subsection{Voice Objects}
49\label{voice-objects}
50
Jack Jansene4be9be1995-02-28 15:46:09 +000051Voice objects contain the description of a voice. It is currently not
52yet possible to access the parameters of a voice.
53
Fred Drake19479911998-02-13 06:58:54 +000054\setindexsubitem{(voice object method)}
Jack Jansene4be9be1995-02-28 15:46:09 +000055
Fred Drake41788db1998-04-04 06:23:02 +000056\begin{methoddesc}[Voice]{GetGender}{}
57Return the gender of the voice: \code{0} for male, \code{1} for female
58and \code{-1} for neuter.
59\end{methoddesc}
Jack Jansene4be9be1995-02-28 15:46:09 +000060
Fred Drake41788db1998-04-04 06:23:02 +000061\begin{methoddesc}[Voice]{NewChannel}{}
62Return a new Speech Channel object using this voice.
63\end{methoddesc}
Jack Jansene4be9be1995-02-28 15:46:09 +000064
Fred Drake41788db1998-04-04 06:23:02 +000065\subsection{Speech Channel Objects}
66\label{speech-channel-objects}
67
68A Speech Channel object allows you to speak strings with slightly more
69control than \function{SpeakString()}, and allows you to use multiple
Jack Jansene4be9be1995-02-28 15:46:09 +000070speakers at the same time. Please note that channel pitch and rate are
Guido van Rossum6bb1adc1995-03-13 10:03:32 +000071interrelated in some way, so that to make your Macintosh sing you will
Jack Jansene4be9be1995-02-28 15:46:09 +000072have to adjust both.
73
Fred Drake41788db1998-04-04 06:23:02 +000074\begin{methoddesc}[Speech Channel]{SpeakText}{str}
Jack Jansene4be9be1995-02-28 15:46:09 +000075Start uttering the given string.
Fred Drake41788db1998-04-04 06:23:02 +000076\end{methoddesc}
Jack Jansene4be9be1995-02-28 15:46:09 +000077
Fred Drake41788db1998-04-04 06:23:02 +000078\begin{methoddesc}[Speech Channel]{Stop}{}
Jack Jansene4be9be1995-02-28 15:46:09 +000079Stop babbling.
Fred Drake41788db1998-04-04 06:23:02 +000080\end{methoddesc}
Jack Jansene4be9be1995-02-28 15:46:09 +000081
Fred Drake41788db1998-04-04 06:23:02 +000082\begin{methoddesc}[Speech Channel]{GetPitch}{}
Guido van Rossum6bb1adc1995-03-13 10:03:32 +000083Return the current pitch of the channel, as a floating-point number.
Fred Drake41788db1998-04-04 06:23:02 +000084\end{methoddesc}
Jack Jansene4be9be1995-02-28 15:46:09 +000085
Fred Drake41788db1998-04-04 06:23:02 +000086\begin{methoddesc}[Speech Channel]{SetPitch}{pitch}
Jack Jansene4be9be1995-02-28 15:46:09 +000087Set the pitch of the channel.
Fred Drake41788db1998-04-04 06:23:02 +000088\end{methoddesc}
Jack Jansene4be9be1995-02-28 15:46:09 +000089
Fred Drake41788db1998-04-04 06:23:02 +000090\begin{methoddesc}[Speech Channel]{GetRate}{}
Jack Jansene4be9be1995-02-28 15:46:09 +000091Get the speech rate (utterances per minute) of the channel as a
92floating point number.
Fred Drake41788db1998-04-04 06:23:02 +000093\end{methoddesc}
Jack Jansene4be9be1995-02-28 15:46:09 +000094
Fred Drake41788db1998-04-04 06:23:02 +000095\begin{methoddesc}[Speech Channel]{SetRate}{rate}
Jack Jansene4be9be1995-02-28 15:46:09 +000096Set the speech rate of the channel.
Fred Drake41788db1998-04-04 06:23:02 +000097\end{methoddesc}
Jack Jansene4be9be1995-02-28 15:46:09 +000098