elevenlabs-python
elevenlabs-python copied to clipboard
Streaming timeout
Was running some streaming tests using the example code from the README:
from elevenlabs import generate, stream
def text_stream():
yield "Hi there, I'm Eleven "
yield "I'm a text to speech API "
audio_stream = generate(
text=text_stream(),
voice="Nicole",
model="eleven_monolingual_v1",
stream=True
)
stream(audio_stream)
but it looks like
https://github.com/elevenlabs/elevenlabs-python/blob/7059dbaba46d06bdcda03b8cdb2dce06d21c07d2/elevenlabs/api/tts.py#L94-L102
always times out, with the result that I send the complete input before I get any audio in the following while loop.
data = json.loads(websocket.recv(1e-4))
I don't understand why the timeout is low. I believe that is 0.1 milliseconds.
Was this fixed? I'm getting regular timeouts on less than half of the allowed characters (using the npm client)