Generate an MP3 file from text using the ElevenLabs Python SDK.
-
Copy the environment file and add your API key:
cp .env.example .env
Then edit
.envand paste your ElevenLabs API key. -
Create a virtual environment and install dependencies:
python3 -m venv .venv .venv/bin/pip install -r requirements.txt
.venv/bin/python main.py "Hello from ElevenLabs"The generated audio is saved to output.mp3.