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