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

Fix PyOgg Import Issue: `name 'c_int_p' / ‘c_uchar_p’ is not defined #1988

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

skywinder
Copy link
Contributor

@skywinder skywinder commented Mar 12, 2025

This is an attempt to fix #1989 the issue with PyOgg failing to import with the error:

name ‘c_int_p’ is not defined

which prevents the Opus codec from being available.

From the main branch, I encountered the following error:

libopus.opus_encode.argtypes = [oe_p, opus_int16_p, c_int, c_uchar_p, opus_int32] NameError: name ‘c_uchar_p’ is not defined. Did you mean: ‘c_char_p’?

On #1981, I still have the issue:

WARNING:root:PyOgg import failed: name 'c_uchar_p' is not defined. Opus codec will not be available.

This PR is an attempt to fix it.

Notes

PS: This is a draft based on #1981. It should only be merged after a careful review and only after #1981.

skywinder and others added 18 commits March 12, 2025 01:43
- Update README.md with detailed instructions for setting up GitHub token
- Improve GitHub API request handling in firmware and plugins utils
- Add warning messages for missing GitHub token
- Handle rate limit scenarios
- Provide clearer guidance on optional GitHub token configuration
…hanism

- Add SSL certificate verification bypass
- Implement try-except block for model loading
- Create mock VAD functions for graceful degradation
- Handle potential model loading failures
- Include detailed steps for resolving Opus library installation issues

- Add verification step to confirm successful library import
…dling

- Implement conditional Typesense client initialization
- Create mock Typesense client for development when configuration is missing
- Update README.md with Typesense configuration instructions
- Add warning message for unconfigured Typesense setup
- Provide setup instructions for Typesense Cloud and self-hosted environments
- Clarify host, port, and API key configuration steps
- Implement direct model file download from GitHub repository
- Add fallback mechanism for Silero VAD model loading
- Handle potential download and loading errors
- Update model file download URL to latest repository location
- Remove redundant file downloads for utils and example files
- Streamline model file retrieval process
- handling of PyOgg import errors
- Create mock OpusDecoder class for limited functionality
- Update README with troubleshooting steps for PyOgg library
@skywinder skywinder changed the title [WIP] feat: PyOgg wrapper for Opus codec Fix PyOgg Import Issue: `name 'c_int_p' / ‘c_uchar_p’ is not defined Mar 12, 2025
@skywinder
Copy link
Contributor Author

related issue
TeamPyOgg/PyOgg#113 (comment)

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.

PyOgg Import Issue: name 'c_int_p' / 'c_uchar_p' is not defined
4 participants