KoljaB / RealtimeTTS

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

How can i send every call to stream.feed(content) straight to synthesize. #31

Closed mercuryyy closed 5 months ago

mercuryyy commented 5 months ago

I made my own logic to build the sentences up.

How can i send each call of

stream.feed(content)

straight into synthesize.

I don't want stream to wait for the next batch or sentence and just go straight to synthesize each time its called.

Have

buffer_threshold_seconds = 0 fast_sentence_fragment = True

KoljaB commented 5 months ago

Call play, that starts synthesis - if I dont miss something?

mercuryyy commented 5 months ago

I am trying to bypass the stream logic where it waits for a full sentence, i want to be able to manually fire synthesize on demand. so even if

content = "This is" stream.feed(content) stream.play_async(muted=True) content = "an example" stream.feed(content)

It will immediately start "synthesize" and not wait for the next context "content = "an example""

KoljaB commented 5 months ago

Use play instead of play_async or wait with while(stream.is_playing()): time.sleep(0.1)

Otherwise feed adds to the playing stream.