write(_:toBufferCallback:)
Generates speech for the utterance and invokes the callback with the audio buffer.
Declaration
func write(_ utterance: AVSpeechUtterance, toBufferCallback bufferCallback: @escaping AVSpeechSynthesizer.BufferCallback)Parameters
- utterance:
The utterance for synthesizing speech.
- bufferCallback:
The system calls this closure with the generated audio buffer.
Discussion
Call this method to receive audio buffers to store or further process synthesized speech.