Skip to content

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

Closed
skywinder wants to merge 18 commits intoBasedHardware:mainfrom
skywinder:fix-c_int_p-PyOgg
Closed

Fix PyOgg Import Issue: `name 'c_int_p' / ‘c_uchar_p’ is not defined#1988
skywinder wants to merge 18 commits intoBasedHardware:mainfrom
skywinder:fix-c_int_p-PyOgg

Conversation

@skywinder
Copy link
Collaborator

@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
Collaborator Author

related issue
TeamPyOgg/PyOgg#113 (comment)

@beastoin
Copy link
Collaborator

/ closed

feel free to reopen it any time man.

@beastoin beastoin closed this Mar 24, 2025
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