Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update narrator.py to reflect API updates #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Domisuh
Copy link

@Domisuh Domisuh commented Apr 23, 2024

ElevenLabs, the company behind the AI voices used in this project, updated their API. This PR updates narrator.py to reflect those changes

mgennings added a commit to mgennings/narrator that referenced this pull request Jul 22, 2024
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant