elevenlabs-python icon indicating copy to clipboard operation
elevenlabs-python copied to clipboard

Streaming timeout

Open zoq opened this issue 1 year ago • 2 comments

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.

zoq avatar Oct 18 '23 14:10 zoq

data = json.loads(websocket.recv(1e-4)) 

I don't understand why the timeout is low. I believe that is 0.1 milliseconds.

rizhang2 avatar Mar 09 '24 22:03 rizhang2

Was this fixed? I'm getting regular timeouts on less than half of the allowed characters (using the npm client)

chadananda avatar Mar 23 '24 16:03 chadananda