Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 4 - Speech Manager / Speech Manager Reference
Speech Manager Routines / Managing Speech Channels


Legacy Documentclose button

Important: Inside Macintosh: Sound is deprecated as of Mac OS X v10.5. For new audio development in Mac OS X, use Core Audio. See the Audio page in the ADC Reference Library.

NewSpeechChannel

You can use the NewSpeechChannel function to create a new speech channel.

FUNCTION NewSpeechChannel (voice: VoiceSpecPtr; 
                              VAR chan: SpeechChannel): OSErr;
voice
A pointer to the voice specification record corresponding to the voice to be used for the new speech channel. Pass NIL to create a speech channel using the system default voice.
chan
On exit, a valid speech channel.
DESCRIPTION
The NewSpeechChannel function allocates memory for a speech channel record and sets the speech channel variable pointed to by the chan parameter to point to this speech channel record. The Speech Manager automatically locates and opens a connection to the proper synthesizer for the voice specified by the voice parameter.

There is no predefined limit to the number of speech channels an application can create. However, system constraints on available RAM, processor loading, and number of available sound channels limit the number of speech channels actually possible.

WARNING
Your application should not attempt to manipulate the data pointed to by a variable of type SpeechChannel. The internal format that the Speech Manager uses for speech channel data is not documented and may change in future versions of system software.
SPECIAL CONSIDERATIONS
Because the NewSpeechChannel function allocates memory, you should not call it at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the NewSpeechChannel function are
Trap macroSelector
_SoundDispatch$0418000C

RESULT CODES
noErr0No error
memFullErr-108Not enough memory to open speech channel
synthOpenFailed-241Could not open another speech synthesizer channel
voiceNotFound-244Voice resource not found

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996