stream

abstract fun stream(request: TextToSpeechRequest): Flow<AudioChunk>(source)

Performs HTTP response streaming. The returned flow is cold and each collection starts a new request. Cancelling collection closes the underlying response. Each emitted AudioChunk is an arbitrary transport chunk, not necessarily a codec frame.

Collection terminates with ApiException, NetworkError, or TimeoutError when the request fails. These failures are emitted by the flow rather than thrown when stream is called.