Spaces:
Runtime error
Runtime error
Download elevenLabs.py from nsgupta1/MockInterviewBot: direct link, hf CLI and curl.
- Browser
- Download file 507 Bytes
-
https://huggingface.co/spaces/nsgupta1/MockInterviewBot/resolve/main/elevenLabs.py
- Command line
-
hf download hf://spaces/nsgupta1/MockInterviewBot/elevenLabs.py
-
curl -L -o elevenLabs.py https://huggingface.co/spaces/nsgupta1/MockInterviewBot/resolve/main/elevenLabs.py
507 Bytes
| from elevenlabs import ElevenLabs | |
| # Initialize the ElevenLabs client with your API key | |
| client = ElevenLabs(api_key="YOUR_API_KEY") | |
| # Generate audio from text | |
| audio = client.generate( | |
| text="Welcome to your mock interview. Let's start with your first question.", | |
| voice="Rachel", # Choose a pre-existing voice or create a custom voice | |
| model="eleven_monolingual_v1" # Use the English-optimized model | |
| ) | |
| # Save the generated audio to a file | |
| with open("output.mp3", "wb") as f: | |
| f.write(audio) | |