KoljaB / RealtimeTTS

Converts text to speech in realtime
1.41k stars 120 forks source link

How to just Generate the .wav chunks but not playback the audio automaticlty. #26

Closed mercuryyy closed 6 months ago

mercuryyy commented 6 months ago

stream.play_async()

logic how can we just start creating the chunks but not initiate the playback of the audio files.

I already added logic in

for i, chunk in enumerate(chunks):

to save the chunks in a folder, but i cant find a simple way to stop the playback without breaking stuff.

KoljaB commented 6 months ago

stream.play_async(muted=True) should do that

mercuryyy commented 6 months ago

thanks, will that just mute the audio but still run the playback? i am trying to save on latency and resources would want to completely disable the playback.

KoljaB commented 6 months ago

With muted=True no data gets written to the output stream. So there is no "silent" playback (where it would lower the volume to 0 or so), it only synthesizes the audio chunks.

mercuryyy commented 6 months ago

Thank you @KoljaB great support and Repo!