OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

ImportError: cannot import name 'play' from 'elevenlabs'

  • Thread starter Thread starter Butinos
  • Start date Start date
B

Butinos

Guest
I'm trying to create my own voice assistant using elevenlabs to synthesize the voice. I copied this code from elevenlabs api documentation:

Code:
from elevenlabs import play
from elevenlabs.client import ElevenLabs

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

audio = client.generate(
  text="Hello! 你好! Hola! नमस्ते! Bonjour! こんにちは! مرحبا! 안녕하세요! Ciao! Cześć! Привіт! வணக்கம்!",
  voice="Rachel",
  model="eleven_multilingual_v2"
)
play(audio)

But i got this error:

from elevenlabs import play ImportError: cannot import name 'play' from 'elevenlabs'

Help me pls!
<p>I'm trying to create my own voice assistant using elevenlabs to synthesize the voice.
I copied this code from elevenlabs api documentation:</p>
<pre><code>from elevenlabs import play
from elevenlabs.client import ElevenLabs

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

audio = client.generate(
text="Hello! 你好! Hola! नमस्ते! Bonjour! こんにちは! مرحبا! 안녕하세요! Ciao! Cześć! Привіт! வணக்கம்!",
voice="Rachel",
model="eleven_multilingual_v2"
)
play(audio)
</code></pre>
<p>But i got this error:</p>
<p>from elevenlabs import play
ImportError: cannot import name 'play' from 'elevenlabs'</p>
<p>Help me pls!</p>
 

Latest posts

Top