This project was inspired by cbh123/narrator.
- Live Camera Capture: Continuously captures frames from your webcam
- Narration: Generates and plays audio narration for the captured frames in the style of Sir David Attenborough
-
Clone the repository and set up a virtual environment:
git clone <repository-url> cd narrator pip install virtualenv virtualenv narrator narrator\Scripts\activate # On Windows source narrator/bin/activate # On MacOS/Linux
-
Install the dependencies:
pip install -r requirements.txt
-
Create accounts and set up your API keys:
- Create an OpenAI account.
- Create an ElevenLabs account.
-
Set your API keys in a new
.envfile in the root directory:OPENAI_API_KEY='your_openai_api_key' ELEVENLABS_API_KEY='your_elevenlabs_api_key' ELEVENLABS_VOICE_ID='your_elevenlabs_voice_id' -
Obtain a voice ID from ElevenLabs:
- Create a new voice in ElevenLabs.
- Get the voice ID using their Get Voices API or by clicking the flask icon next to the voice in the VoiceLab tab.
- Add the voice ID to the
.envfile.
Please ensure that you only use voices for which you have the legal rights and permissions. Unauthorized use of voices may infringe on intellectual property rights and privacy laws.
Run the main script in the terminal:
python app.py- Custom Image Narration: If you prefer not to use the capture camera code, you can replace the
frame.jpgimage in the./frames/directory with an image of your choice. When you start the narration, the program will narrate the image you placed there instead.