---
title: "write(_:toBufferCallback:toMarkerCallback:)"
framework: avfaudio
role: symbol
role_heading: Instance Method
path: "avfaudio/avspeechsynthesizer/write(_:tobuffercallback:tomarkercallback:)"
---

# write(_:toBufferCallback:toMarkerCallback:)

Generates audio buffers and associated metadata for storage or further speech synthesis processing.

## Declaration

```swift
func write(_ utterance: AVSpeechUtterance, toBufferCallback bufferCallback: @escaping AVSpeechSynthesizer.BufferCallback, toMarkerCallback markerCallback: @escaping AVSpeechSynthesizer.MarkerCallback)
```

## Parameters

- `utterance`: A utterance for a synthesizer to speak.
- `bufferCallback`: A callback that the system invokes with the synthesized audio data.
- `markerCallback`: A callback that the system invokes with marker information.

## See Also

### Directing speech output

- [usesApplicationAudioSession](avfaudio/avspeechsynthesizer/usesapplicationaudiosession.md)
- [mixToTelephonyUplink](avfaudio/avspeechsynthesizer/mixtotelephonyuplink.md)
- [outputChannels](avfaudio/avspeechsynthesizer/outputchannels.md)
- [write(_:toBufferCallback:)](avfaudio/avspeechsynthesizer/write(_:tobuffercallback:).md)
- [AVSpeechSynthesizer.BufferCallback](avfaudio/avspeechsynthesizer/buffercallback.md)
- [AVSpeechSynthesizer.MarkerCallback](avfaudio/avspeechsynthesizer/markercallback.md)
