---
title: SpeakString
framework: Application Services
role: symbol
role_heading: Function
platforms: [macOS 10.0+]
path: applicationservices/1552250-speakstring
---

# SpeakString

Begins speaking a text string.

## Declaration

```occ
OSErr SpeakString(ConstStr255Param textToBeSpoken);
```

## Parameters

- `textToBeSpoken`: The string to be spoken.

## Return Value

A resultcode. See [Result Codes](speech_synthesis_manager.md).

## Discussion

The `SpeakString` functionattempts to speak the Pascal-style text string contained in the string `textToBeSpoken`.Speech is produced asynchronously using the default system voice.When an application calls this function, the Speech Synthesis Managermakes a copy of the passed string and creates any structures requiredto speak it. As soon as speaking has begun, control is returnedto the application. The synthesized speech is generated asynchronously tothe application so that normal processing can continue while thetext is being spoken. No further interaction with the Speech SynthesisManager is required at this point, and the application is free torelease the memory that the original string occupied.

If `SpeakString` iscalled while a prior string is still being spoken, the sound currentlybeing synthesized is interrupted immediately. Conversion of thenew text into speech is then begun. If you pass a zero-length string(or, in C, a `null` pointer)to `SpeakString`, the Speech SynthesisManager stops any speech previously being synthesized by `SpeakString` without generatingadditional speech. If your application uses `SpeakString`,it is often a good idea to stop any speech in progress wheneveryour application receives a suspend event. Calling `SpeakString` witha zero-length string has no effect on speech channels other than theone managed internally by the Speech Synthesis Manager for the `SpeakString` function.)

The text passed to the `SpeakString` functionmay contain embedded speech commands. 

## See Also

### Starting, Stopping, and Pausing Speech

- [ContinueSpeech](1462728-continuespeech.md)
- [PauseSpeechAt](1461174-pausespeechat.md)
- [SpeakBuffer](1552252-speakbuffer.md)
- [SpeakCFString](1461621-speakcfstring.md)
- [SpeakText](1552236-speaktext.md)
- [StopSpeech](1462745-stopspeech.md)
- [StopSpeechAt](1459780-stopspeechat.md)
