---
title: "startSpeaking(_:to:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsspeechsynthesizer/startspeaking(_:to:)"
---

# startSpeaking(_:to:)

Begins synthesizing text into a sound (AIFF) file.

## Declaration

```swift
func startSpeaking(_ string: String, to url: URL) -> Bool
```

## Parameters

- `string`: Text to speak. When nil or empty, no synthesis is started.
- `url`: Filesystem location of the output sound file.

## Return Value

Return Value true when synthesis starts successfully, false otherwise.

## Discussion

Discussion When synthesis of text finishes normally or is stopped, the message speechSynthesizer(_:didFinishSpeaking:) is sent to the delegate. One example of how you might use this method is in an email program that automatically converts new messages into sound files that can be stored on an iPod for later listening. note: In OS X V 10.4 and earlier, the delegate does not receive speechSynthesizer(_:willSpeakWord:of:) and speechSynthesizer(_:willSpeakPhoneme:) messages when text is being synthesized to a file.

## See Also

### Synthesizing Speech

- [isSpeaking](appkit/nsspeechsynthesizer/isspeaking.md)
- [startSpeaking(_:)](appkit/nsspeechsynthesizer/startspeaking(_:).md)
- [pauseSpeaking(at:)](appkit/nsspeechsynthesizer/pausespeaking(at:).md)
- [continueSpeaking()](appkit/nsspeechsynthesizer/continuespeaking().md)
- [stopSpeaking()](appkit/nsspeechsynthesizer/stopspeaking().md)
- [stopSpeaking(at:)](appkit/nsspeechsynthesizer/stopspeaking(at:).md)
- [NSSpeechSynthesizer.Boundary](appkit/nsspeechsynthesizer/boundary.md)
