blob: 340b8132c6518148e34beb581214d5375918e275 [file] [log] [blame]
Fred Drakec817e271998-08-10 18:40:22 +00001\section{\module{macspeech} ---
2 Interface to the Macintosh Speech Manager.}
Fred Drakefe7f3bc1998-07-23 17:55:31 +00003\declaremodule{builtin}{macspeech}
4
5\modulesynopsis{Interface to the Macintosh Speech Manager.}
6
Jack Jansene4be9be1995-02-28 15:46:09 +00007
Guido van Rossum86751151995-02-28 17:14:32 +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
Guido van Rossum96628a91995-04-10 11:34:00 +000015provide full access to all features of the Speech Manager yet. It may
16not be available in all Mac Python versions.
Jack Jansene4be9be1995-02-28 15:46:09 +000017
18\begin{funcdesc}{Available}{}
19Test availability of the Speech Manager extension (and, on the
Fred Drake41788db1998-04-04 06:23:02 +000020PowerPC, the Speech Manager shared library). Return \code{0} or
21\code{1}.
Jack Jansene4be9be1995-02-28 15:46:09 +000022\end{funcdesc}
23
24\begin{funcdesc}{Version}{}
Guido van Rossum6bb1adc1995-03-13 10:03:32 +000025Return the (integer) version number of the Speech Manager.
Jack Jansene4be9be1995-02-28 15:46:09 +000026\end{funcdesc}
27
28\begin{funcdesc}{SpeakString}{str}
29Utter the string \var{str} using the default voice,
30asynchronously. This aborts any speech that may still be active from
Fred Drake41788db1998-04-04 06:23:02 +000031prior \function{SpeakString()} invocations.
Jack Jansene4be9be1995-02-28 15:46:09 +000032\end{funcdesc}
33
34\begin{funcdesc}{Busy}{}
35Return the number of speech channels busy, system-wide.
36\end{funcdesc}
37
38\begin{funcdesc}{CountVoices}{}
39Return the number of different voices available.
40\end{funcdesc}
41
42\begin{funcdesc}{GetIndVoice}{num}
Fred Drake41788db1998-04-04 06:23:02 +000043Return a \pytype{Voice} object for voice number \var{num}.
Jack Jansene4be9be1995-02-28 15:46:09 +000044\end{funcdesc}
45
Fred Drake41788db1998-04-04 06:23:02 +000046\subsection{Voice Objects}
47\label{voice-objects}
48
Jack Jansene4be9be1995-02-28 15:46:09 +000049Voice objects contain the description of a voice. It is currently not
50yet possible to access the parameters of a voice.
51
Fred Drake19479911998-02-13 06:58:54 +000052\setindexsubitem{(voice object method)}
Jack Jansene4be9be1995-02-28 15:46:09 +000053
Fred Drake41788db1998-04-04 06:23:02 +000054\begin{methoddesc}[Voice]{GetGender}{}
55Return the gender of the voice: \code{0} for male, \code{1} for female
56and \code{-1} for neuter.
57\end{methoddesc}
Jack Jansene4be9be1995-02-28 15:46:09 +000058
Fred Drake41788db1998-04-04 06:23:02 +000059\begin{methoddesc}[Voice]{NewChannel}{}
60Return a new Speech Channel object using this voice.
61\end{methoddesc}
Jack Jansene4be9be1995-02-28 15:46:09 +000062
Fred Drake41788db1998-04-04 06:23:02 +000063\subsection{Speech Channel Objects}
64\label{speech-channel-objects}
65
66A Speech Channel object allows you to speak strings with slightly more
67control than \function{SpeakString()}, and allows you to use multiple
Jack Jansene4be9be1995-02-28 15:46:09 +000068speakers at the same time. Please note that channel pitch and rate are
Guido van Rossum6bb1adc1995-03-13 10:03:32 +000069interrelated in some way, so that to make your Macintosh sing you will
Jack Jansene4be9be1995-02-28 15:46:09 +000070have to adjust both.
71
Fred Drake41788db1998-04-04 06:23:02 +000072\begin{methoddesc}[Speech Channel]{SpeakText}{str}
Jack Jansene4be9be1995-02-28 15:46:09 +000073Start uttering the given string.
Fred Drake41788db1998-04-04 06:23:02 +000074\end{methoddesc}
Jack Jansene4be9be1995-02-28 15:46:09 +000075
Fred Drake41788db1998-04-04 06:23:02 +000076\begin{methoddesc}[Speech Channel]{Stop}{}
Jack Jansene4be9be1995-02-28 15:46:09 +000077Stop babbling.
Fred Drake41788db1998-04-04 06:23:02 +000078\end{methoddesc}
Jack Jansene4be9be1995-02-28 15:46:09 +000079
Fred Drake41788db1998-04-04 06:23:02 +000080\begin{methoddesc}[Speech Channel]{GetPitch}{}
Guido van Rossum6bb1adc1995-03-13 10:03:32 +000081Return the current pitch of the channel, as a floating-point number.
Fred Drake41788db1998-04-04 06:23:02 +000082\end{methoddesc}
Jack Jansene4be9be1995-02-28 15:46:09 +000083
Fred Drake41788db1998-04-04 06:23:02 +000084\begin{methoddesc}[Speech Channel]{SetPitch}{pitch}
Jack Jansene4be9be1995-02-28 15:46:09 +000085Set the pitch of the channel.
Fred Drake41788db1998-04-04 06:23:02 +000086\end{methoddesc}
Jack Jansene4be9be1995-02-28 15:46:09 +000087
Fred Drake41788db1998-04-04 06:23:02 +000088\begin{methoddesc}[Speech Channel]{GetRate}{}
Jack Jansene4be9be1995-02-28 15:46:09 +000089Get the speech rate (utterances per minute) of the channel as a
90floating point number.
Fred Drake41788db1998-04-04 06:23:02 +000091\end{methoddesc}
Jack Jansene4be9be1995-02-28 15:46:09 +000092
Fred Drake41788db1998-04-04 06:23:02 +000093\begin{methoddesc}[Speech Channel]{SetRate}{rate}
Jack Jansene4be9be1995-02-28 15:46:09 +000094Set the speech rate of the channel.
Fred Drake41788db1998-04-04 06:23:02 +000095\end{methoddesc}
Jack Jansene4be9be1995-02-28 15:46:09 +000096