elevenlabs / elevenlabs-python

The official Python API for ElevenLabs Text to Speech.
https://elevenlabs.io/docs/api-reference/getting-started
MIT License
2.19k stars 253 forks source link

question: how can i download elevenlabs response locally? #87

Closed AbubakrChan closed 1 year ago

AbubakrChan commented 1 year ago

My question is how can i download elevenlabs response locally?

Thank you!!

flavioschneider commented 1 year ago

https://github.com/elevenlabs/elevenlabs-python/blob/main/API.md#save

from elevenlabs import generate, save

audio = generate(
    text="Hi there",
    voice="Arnold",
    model='eleven_multilingual_v1'
)

save(audio, 'myvoice.mp3')
AbubakrChan commented 1 year ago

https://github.com/elevenlabs/elevenlabs-python/blob/main/API.md#save

from elevenlabs import generate, save

audio = generate(
    text="Hi there",
    voice="Arnold",
    model='eleven_multilingual_v1'
)

save(audio, 'myvoice.mp3')

Hey Thank you soo much for your prompt response!! I will try this out right now.

AbubakrChan commented 1 year ago

I am building a chatbot in gradio using whisper and elevenlabs, so that user can talk to and listen to the chatbot:

image

When running it locally I was using elevenlabs Play( ) function to play the audio response and everything was working fine.

And now when I have deployed it on heroku everything is working same as it is except that the elevenlabs audio is not played.

I noticed that previously the audio was played on my system and not on the website (when running locally), that's why when i even close the website the audio was still playing and now when it is deployed on internet it is no longer working.

Searching for solution of this I created this issue so that I can save the audio in some database and later play it..... But this may not work either because my code is on huggingface and the saved file wouldn't be saved there in the repo...

I highly require your help @flavioschneider in this regard, this issue is soo concerning to me.

I truly appreciate your efforts!!

Thank you for your help.

AbubakrChan commented 1 year ago

Hey @flavioschneider ,

Sorry to disturb you but could you please guide me to the right way or provide any resources which can potentially help me.

Thanks