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

SSML not recognized when streaming. #352

Open
EllenOrange opened this issue Sep 10, 2024 · 0 comments
Open

SSML not recognized when streaming. #352

EllenOrange opened this issue Sep 10, 2024 · 0 comments

Comments

@EllenOrange
Copy link

EllenOrange commented Sep 10, 2024

Hi folks,

As the title suggests, when using streaming with the 1.7.0 version of the python interface, it seems like ssml isn't recognized; instead it's read as part of the narration. Perhaps I'm not setting some needed switch in client.generate, but I've combed the api docs and can't find a solution.

Here's a minimum reproducible example:

from elevenlabs.client import ElevenLabs
from elevenlabs import play, stream

ssml_test_string1 = 'This is the beginning of a beautiful '
ssml_test_string2 = '<break time="1.0s"/> friendship.'

client = ElevenLabs()

audio = client.generate(
  text=ssml_test_string1 + ssml_test_string2,
  voice="Rachel",
  model="eleven_turbo_v2"
)
play(audio)

def text_stream():
    yield ssml_test_string1
    yield ssml_test_string2

audio_stream = client.generate(
    text=text_stream(),
    voice="Rachel",
    model="eleven_turbo_v2",
    stream=True
)

stream(audio_stream)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant