forked from cbh123/narrator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update narrator.py and capture.py to reflect ElevenLabs API upd…
…ates This commit addresses changes made to update the ElevenLabs API version as per pull request cbh123#51 (Update narrator.py to reflect API updates cbh123#51 - cbh123#51). The following changes have been made: narrator.py: - Updated the ElevenLabs client instantiation to the new API format. - Removed the deprecated `set_api_key` and `get_api_key` methods and replaced them with the `ElevenLabs` class instantiation. - Modified the `play_audio` function to handle the audio generator properly by collecting the audio data into a bytes-like object before writing it to a file and playing it. - Added detailed docstrings and comments for better understanding and maintenance of the code. - Ensured that the OpenAI client uses the correct API key and updated the image analysis to handle responses accurately. capture.py: - 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. These changes ensure compatibility with the latest ElevenLabs API and improve the overall robustness and readability of the code.
- Loading branch information
Showing
4 changed files
with
90 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,7 @@ | |
/venv | ||
/narration | ||
/frames/* | ||
!/frames/.gitkeep | ||
!/frames/.gitkeep | ||
|
||
# DS_STORE | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters