summaryrefslogtreecommitdiffstats
path: root/Doc/mac/libmacspeech.tex
blob: 20221788aa792313c1d076d707b3096a29eaa79d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
\section{\module{macspeech} ---
         Interface to the Macintosh Speech Manager}

\declaremodule{builtin}{macspeech}
  \platform{Mac}
\modulesynopsis{Interface to the Macintosh Speech Manager.}


This module provides an interface to the Macintosh Speech Manager,
\index{Macintosh Speech Manager}
\index{Speech Manager, Macintosh}
allowing you to let the Macintosh utter phrases. You need a version of
the Speech Manager extension (version 1 and 2 have been tested) in
your \file{Extensions} folder for this to work. The module does not
provide full access to all features of the Speech Manager.

This module is only available on MacOS9 and earlier in classic PPC
MacPython.

\begin{funcdesc}{Available}{}
Test availability of the Speech Manager extension (and, on the
PowerPC, the Speech Manager shared library). Return \code{0} or
\code{1}.
\end{funcdesc}

\begin{funcdesc}{Version}{}
Return the (integer) version number of the Speech Manager.
\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 \function{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 \pytype{Voice} object for voice number \var{num}.
\end{funcdesc}

\subsection{Voice Objects}
\label{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)}

\begin{methoddesc}[Voice]{GetGender}{}
Return the gender of the voice: \code{0} for male, \code{1} for female
and \code{-1} for neuter.
\end{methoddesc}

\begin{methoddesc}[Voice]{NewChannel}{}
Return a new Speech Channel object using this voice.
\end{methoddesc}

\subsection{Speech Channel Objects}
\label{speech-channel-objects}

A Speech Channel object allows you to speak strings with slightly more
control than \function{SpeakString()}, and allows you to use multiple
speakers at the same time. Please note that channel pitch and rate are
interrelated in some way, so that to make your Macintosh sing you will
have to adjust both.

\begin{methoddesc}[Speech Channel]{SpeakText}{str}
Start uttering the given string.
\end{methoddesc}

\begin{methoddesc}[Speech Channel]{Stop}{}
Stop babbling.
\end{methoddesc}

\begin{methoddesc}[Speech Channel]{GetPitch}{}
Return the current pitch of the channel, as a floating-point number.
\end{methoddesc}

\begin{methoddesc}[Speech Channel]{SetPitch}{pitch}
Set the pitch of the channel.
\end{methoddesc}

\begin{methoddesc}[Speech Channel]{GetRate}{}
Get the speech rate (utterances per minute) of the channel as a
floating point number.
\end{methoddesc}

\begin{methoddesc}[Speech Channel]{SetRate}{rate}
Set the speech rate of the channel.
\end{methoddesc}