Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming Input Example Does not Work until whole Input is Send #395

Open
gwpl opened this issue Oct 29, 2024 · 0 comments
Open

Streaming Input Example Does not Work until whole Input is Send #395

gwpl opened this issue Oct 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@gwpl
Copy link

gwpl commented Oct 29, 2024

Description

I've been sending one line at a time ending with punctuation,
either from other program generating stream of text ,
or just by hand from terminal,
and it looks like no audio is happening in speakers
until whole text is read (or timeout encountered),
even if each line ends with punctuaction!

Code example

#!/usr/bin/env python3

from elevenlabs.client import ElevenLabs
from elevenlabs import stream

client = ElevenLabs(
#  api_key="YOUR_API_KEY", # Defaults to ELEVEN_API_KEY
)

import sys

def generate_text_line_yielder(file_object):
    def text_stream():
        for line in file_object:
            yield line
    return text_stream

text_stream = generate_text_line_yielder(sys.stdin)

#voice_model="eleven_multilingual_v2"
voice_model="eleven_turbo_v2_5"
audio_stream = client.generate(
    text=text_stream(),
    voice="Brian",
    model=voice_model,
    stream=True
)

stream(audio_stream)

Additional context

I wonder if iit's related to #344 and could be fixed by PR referenced there or if it's other issue.

@gwpl gwpl added the bug Something isn't working label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant