<!--
{
  "availability" : [
    "macOS: 10.3.0 - 14.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSpeechSynthesizer/startSpeaking(_:to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSSpeechSynthesizer(im)startSpeakingString:toURL:"
  },
  "title" : "startSpeaking(_:to:)"
}
-->

# startSpeaking(_:to:)

Begins synthesizing text into a sound (AIFF) file.

```
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

<doc://com.apple.documentation/documentation/Swift/true> when synthesis starts successfully, <doc://com.apple.documentation/documentation/Swift/false> otherwise.

## Discussion

When synthesis of `text` finishes normally or is stopped, the message [`speechSynthesizer(_:didFinishSpeaking:)`](/documentation/AppKit/NSSpeechSynthesizerDelegate/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 ``doc://com.apple.appkit/documentation/AppKit/NSSpeechSynthesizerDelegate/speechSynthesizer(_:willSpeakWord:of:)`` and ``doc://com.apple.appkit/documentation/AppKit/NSSpeechSynthesizerDelegate/speechSynthesizer(_:willSpeakPhoneme:)`` messages when text is being synthesized to a file.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)