This is the main script for the project. It uses the ElevenLabs
client to convert text to speech. The text to be converted, the voice settings, and the output format are all configurable.
The script first initializes the ElevenLabs
client with the API key. It then uses the text_to_speech.convert
method to convert the text to speech. The voice ID, streaming latency optimization, and output format are all set as parameters. The text to be converted is a quote from the movie "Forrest Gump". The voice settings are also configured to add a touch of style to the speech.
The script is designed to be run from the command line, with the API key provided as an environment variable.
To use this project, follow these steps:
- Install the required libraries by running
pip install elevenlabs
. - Set up your ElevenLabs API key as an environment variable named
ELEVENLABS_API_KEY
. - Run the script using
python main.py
.
To see examples of the output generated by this script, check out:
The MP3 file contains an audio version of the generated dialogue, while the transcript file shows the text version of the conversation between the host, Alex, and Sarah discussing various tech news topics.