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 theNewSpeechChannel
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
TheNewSpeechChannel
function allocates memory for a speech channel record and sets the speech channel variable pointed to by thechan
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 thevoice
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 theNewSpeechChannel
function allocates memory, you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theNewSpeechChannel
function are
Trap macro Selector _SoundDispatch
$0418000C RESULT CODES
noErr 0 No error memFullErr -108 Not enough memory to open speech channel synthOpenFailed -241 Could not open another speech synthesizer channel voiceNotFound -244 Voice resource not found