TTSStream
final class TTSStream: SendableBidirectional / pull-based streaming synthesis handle supporting Level 2 incremental LLM text pushing (pushText + finishInput) alongside readNext() and cancel().
-
Lock-free cancellation for this stream.
Declaration
Swift
final func cancel() -
Cancels any in-flight synthesis and marks this stream as closed.
The underlying native
MpTextToSpeechStreamPtris destroyed indeinitonce all in-flight calls onselfhave returned.Declaration
Swift
final func close() -
Marks the end of incremental text input, flushing any trailing partial sentence.
Declaration
Swift
final func finishInput() throws -
Appends an incremental text fragment into the sentence chunker.
Declaration
Swift
final func pushText(_ textDelta: String) throws -
Pulls the next synthesized
AudioChunksynchronously on the calling thread, or returnsnilwhen the stream reaches end-of-stream.Declaration
Swift
final func readNext() throws -> AudioChunk?