Flushing the Text-to-Speech Server Buffer Mid-Stream #742
-
We’re using the example code from the documentation, which allows us to stream text asynchronously and play the audio as it’s ready. This functionality is fantastic! However, in our use case, we occasionally encounter short pieces of text that we would like to process and play immediately. From the documentation: "There is a text buffer on the server side. Only when this buffer reaches a certain size will an audio event be generated. Sending a stop event will force the buffer to be flushed, return an audio event, and end the session." In our scenario, we have cases like: Is there a way to trigger the buffer to flush within that 10-second pause before the buffer reaches its full size? While we could send a stop event to force the buffer to flush and then restart, this disrupts the input stream and introduces extra complexity. It would be incredibly helpful if there were a way to send a command like flush to process the current buffer without ending the session. Is there an existing way to achieve this, or would this require additional support in the API? Thanks in advance for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@leng-yue any thoughts on this? |
Beta Was this translation helpful? Give feedback.
Thanks for the feedback, we have added a
flush
event :)