Release Title
Release 1.0: Major Update with Enhanced API Integration and Improved Functionality
Release Description
We are excited to announce the release of Version 1.0 of the Narrator project. This major update brings significant enhancements to the application, including updated API integrations, improved security, and optimized performance. Below are the key features and changes included in this release.
New Features and Enhancements
-
Updated ElevenLabs API Integration
- Refactored the application to use the new ElevenLabs client instantiation method.
- Replaced deprecated
set_api_key
andget_api_key
methods with the newElevenLabs
class instantiation. - Modified the
play_audio
function to handle the audio generator correctly, gathering audio data into a bytes-like object before writing it to a file and playing it.
-
Improved Security with Environment Variables
- Updated
narrator.py
to load API keys and other sensitive information from a.env
file using thepython-dotenv
package. - Modified
requirements.txt
to include thepython-dotenv
package. - Revised the README file to provide clear instructions on setting up and using the
.env
file for managing environment variables. - The
.env
file is included in.gitignore
to ensure that personal API keys are kept private.
- Updated
-
Enhanced
narrator.py
Functionality- Added detailed docstrings and comments to improve code readability and maintenance.
- Ensured that the OpenAI client uses the correct API key and updated the image analysis to handle responses accurately.
- Improved error handling and logging for better debugging and reliability.
-
Optimized
capture.py
Performance- Ensured the frames folder is created if it doesn't exist.
- Updated the webcam initialization check and added a wait time for the camera to adjust light levels.
- Adjusted the image resizing logic to improve performance before saving the frame.
- Added detailed print statements and comments for clarity and debugging purposes.
Bug Fixes
- Fixed issues related to outdated API integrations causing the application to fail.
- Addressed bugs that prevented proper handling and playing of audio files.
Breaking Changes
- Users must now configure a
.env
file for environment variables, as hard-coded API keys are no longer supported.
Installation and Setup
-
Clone the Repository:
git clone https://github.com/cbh123/narrator.git cd narrator
-
Setup a Virtual Environment:
python3 -m venv venv source venv/bin/activate
-
Install Dependencies:
pip install -r requirements.txt
-
Configure Environment Variables:
- Create a
.env
file in the root directory of your project. - Add your API keys and other sensitive information in the following format:
OPENAI_API_KEY=your_openai_api_key ELEVENLABS_API_KEY=your_elevenlabs_api_key ELEVENLABS_VOICE_ID=your_elevenlabs_voice_id
- Create a
-
Run the Application:
- Start the webcam capture:
python capture.py
- In another terminal, run the narrator:
python narrator.py
- Start the webcam capture:
Additional Notes
- For more detailed setup instructions, please refer to the updated README file.
We appreciate the community’s contributions and feedback that made this release possible. We look forward to your continued support and suggestions to make the Narrator project even better.
Thank you for using our application!