Guido van Rossum | 470be14 | 1995-03-17 16:07:09 +0000 | [diff] [blame] | 1 | \section{Built-in Module \sectcode{macspeech}} |
Guido van Rossum | e47da0a | 1997-07-17 16:34:52 +0000 | [diff] [blame] | 2 | \label{module-macspeech} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 3 | \bimodindex{macspeech} |
| 4 | |
Guido van Rossum | 8675115 | 1995-02-28 17:14:32 +0000 | [diff] [blame] | 5 | \renewcommand{\indexsubitem}{(in module macspeech)} |
| 6 | |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 7 | This module provides an interface to the Macintosh Speech Manager, |
Guido van Rossum | 6bb1adc | 1995-03-13 10:03:32 +0000 | [diff] [blame] | 8 | allowing you to let the Macintosh utter phrases. You need a version of |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 9 | the speech manager extension (version 1 and 2 have been tested) in |
| 10 | your \code{Extensions} folder for this to work. The module does not |
Guido van Rossum | 96628a9 | 1995-04-10 11:34:00 +0000 | [diff] [blame] | 11 | provide full access to all features of the Speech Manager yet. It may |
| 12 | not be available in all Mac Python versions. |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 13 | |
| 14 | \begin{funcdesc}{Available}{} |
| 15 | Test availability of the Speech Manager extension (and, on the |
Guido van Rossum | 6bb1adc | 1995-03-13 10:03:32 +0000 | [diff] [blame] | 16 | PowerPC, the Speech Manager shared library). Return 0 or 1. |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 17 | \end{funcdesc} |
| 18 | |
| 19 | \begin{funcdesc}{Version}{} |
Guido van Rossum | 6bb1adc | 1995-03-13 10:03:32 +0000 | [diff] [blame] | 20 | Return the (integer) version number of the Speech Manager. |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 21 | \end{funcdesc} |
| 22 | |
| 23 | \begin{funcdesc}{SpeakString}{str} |
| 24 | Utter the string \var{str} using the default voice, |
| 25 | asynchronously. This aborts any speech that may still be active from |
| 26 | prior \code{SpeakString} invocations. |
| 27 | \end{funcdesc} |
| 28 | |
| 29 | \begin{funcdesc}{Busy}{} |
| 30 | Return the number of speech channels busy, system-wide. |
| 31 | \end{funcdesc} |
| 32 | |
| 33 | \begin{funcdesc}{CountVoices}{} |
| 34 | Return the number of different voices available. |
| 35 | \end{funcdesc} |
| 36 | |
| 37 | \begin{funcdesc}{GetIndVoice}{num} |
| 38 | Return a voice object for voice number \var{num}. |
| 39 | \end{funcdesc} |
| 40 | |
| 41 | \subsection{voice objects} |
| 42 | Voice objects contain the description of a voice. It is currently not |
| 43 | yet possible to access the parameters of a voice. |
| 44 | |
| 45 | \renewcommand{\indexsubitem}{(voice object method)} |
| 46 | |
| 47 | \begin{funcdesc}{GetGender}{} |
Guido van Rossum | 6bb1adc | 1995-03-13 10:03:32 +0000 | [diff] [blame] | 48 | Return the gender of the voice:\ 0 for male, 1 for female and $-1$ for neuter. |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 49 | \end{funcdesc} |
| 50 | |
| 51 | \begin{funcdesc}{NewChannel}{} |
| 52 | Return a new speech channel object using this voice. |
| 53 | \end{funcdesc} |
| 54 | |
| 55 | \subsection{speech channel objects} |
| 56 | A speech channel object allows you to speak strings with slightly more |
| 57 | control than \code{SpeakString()}, and allows you to use multiple |
| 58 | speakers at the same time. Please note that channel pitch and rate are |
Guido van Rossum | 6bb1adc | 1995-03-13 10:03:32 +0000 | [diff] [blame] | 59 | interrelated in some way, so that to make your Macintosh sing you will |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 60 | have to adjust both. |
| 61 | |
| 62 | \renewcommand{\indexsubitem}{(speech channel object method)} |
| 63 | \begin{funcdesc}{SpeakText}{str} |
| 64 | Start uttering the given string. |
| 65 | \end{funcdesc} |
| 66 | |
| 67 | \begin{funcdesc}{Stop}{} |
| 68 | Stop babbling. |
| 69 | \end{funcdesc} |
| 70 | |
| 71 | \begin{funcdesc}{GetPitch}{} |
Guido van Rossum | 6bb1adc | 1995-03-13 10:03:32 +0000 | [diff] [blame] | 72 | Return the current pitch of the channel, as a floating-point number. |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 73 | \end{funcdesc} |
| 74 | |
| 75 | \begin{funcdesc}{SetPitch}{pitch} |
| 76 | Set the pitch of the channel. |
| 77 | \end{funcdesc} |
| 78 | |
| 79 | \begin{funcdesc}{GetRate}{} |
| 80 | Get the speech rate (utterances per minute) of the channel as a |
| 81 | floating point number. |
| 82 | \end{funcdesc} |
| 83 | |
| 84 | \begin{funcdesc}{SetRate}{rate} |
| 85 | Set the speech rate of the channel. |
| 86 | \end{funcdesc} |
| 87 | |