annotate Doc/mac/libmacspeech.tex @ 4566:6403c94de50d legacy-trunk

Added safeguard against failure in __del__.
author Guido van Rossum <guido@python.org>
date Wed, 27 Nov 1996 19:39:58 +0000
parents 9b7e6d9a528d
children 3468ea8645ca
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2576
f47bc5554418 mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents: 2527
diff changeset
1 \section{Built-in Module \sectcode{macspeech}}
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2 \bimodindex{macspeech}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2452
diff changeset
4 \renewcommand{\indexsubitem}{(in module macspeech)}
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2452
diff changeset
5
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
6 This module provides an interface to the Macintosh Speech Manager,
2527
815dfaa6a778 small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents: 2453
diff changeset
7 allowing you to let the Macintosh utter phrases. You need a version of
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
8 the speech manager extension (version 1 and 2 have been tested) in
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
9 your \code{Extensions} folder for this to work. The module does not
2647
9b7e6d9a528d typos, layout and other small things
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
10 provide full access to all features of the Speech Manager yet. It may
9b7e6d9a528d typos, layout and other small things
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
11 not be available in all Mac Python versions.
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
12
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
13 \begin{funcdesc}{Available}{}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
14 Test availability of the Speech Manager extension (and, on the
2527
815dfaa6a778 small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents: 2453
diff changeset
15 PowerPC, the Speech Manager shared library). Return 0 or 1.
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
16 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
17
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
18 \begin{funcdesc}{Version}{}
2527
815dfaa6a778 small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents: 2453
diff changeset
19 Return the (integer) version number of the Speech Manager.
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
20 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
21
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
22 \begin{funcdesc}{SpeakString}{str}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
23 Utter the string \var{str} using the default voice,
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
24 asynchronously. This aborts any speech that may still be active from
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
25 prior \code{SpeakString} invocations.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
26 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
27
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
28 \begin{funcdesc}{Busy}{}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
29 Return the number of speech channels busy, system-wide.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
30 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
31
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
32 \begin{funcdesc}{CountVoices}{}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
33 Return the number of different voices available.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
34 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
35
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
36 \begin{funcdesc}{GetIndVoice}{num}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
37 Return a voice object for voice number \var{num}.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
38 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
39
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
40 \subsection{voice objects}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
41 Voice objects contain the description of a voice. It is currently not
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
42 yet possible to access the parameters of a voice.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
43
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
44 \renewcommand{\indexsubitem}{(voice object method)}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
45
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
46 \begin{funcdesc}{GetGender}{}
2527
815dfaa6a778 small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents: 2453
diff changeset
47 Return the gender of the voice:\ 0 for male, 1 for female and $-1$ for neuter.
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
48 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
49
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
50 \begin{funcdesc}{NewChannel}{}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
51 Return a new speech channel object using this voice.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
52 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
53
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
54 \subsection{speech channel objects}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
55 A speech channel object allows you to speak strings with slightly more
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
56 control than \code{SpeakString()}, and allows you to use multiple
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
57 speakers at the same time. Please note that channel pitch and rate are
2527
815dfaa6a778 small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents: 2453
diff changeset
58 interrelated in some way, so that to make your Macintosh sing you will
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
59 have to adjust both.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
60
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
61 \renewcommand{\indexsubitem}{(speech channel object method)}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
62 \begin{funcdesc}{SpeakText}{str}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
63 Start uttering the given string.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
64 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
65
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
66 \begin{funcdesc}{Stop}{}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
67 Stop babbling.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
68 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
69
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
70 \begin{funcdesc}{GetPitch}{}
2527
815dfaa6a778 small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents: 2453
diff changeset
71 Return the current pitch of the channel, as a floating-point number.
2452
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
72 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
73
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
74 \begin{funcdesc}{SetPitch}{pitch}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
75 Set the pitch of the channel.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
76 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
77
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
78 \begin{funcdesc}{GetRate}{}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
79 Get the speech rate (utterances per minute) of the channel as a
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
80 floating point number.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
81 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
82
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
83 \begin{funcdesc}{SetRate}{rate}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
84 Set the speech rate of the channel.
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
85 \end{funcdesc}
9efd408fc9f6 Three down, two to go...
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
86