Skip to content

Problems of loading opus library #97

@CyberRex0

Description

@CyberRex0

There seems to be a problem with library_loader.py, which loads the Opus library.

In lines 104 to 105 of library_loader.py, it seems that a path is added to expand the library search range, but this prevents the globally installed Opus library from being loaded in some environments.

This is the REPL when we confirmed that the process of extending the search range was causing the problem:

>>> import ctypes.util
>>> ctypes.util.find_library('opus')
'libopus.so'
>>> import pyogg
>>> pyogg.OpusEncoder()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/pyogg/__init__.py", line 74, in __init__
    raise PyOggError("The Opus library wasn't found or couldn't be loaded (maybe you're trying to use 64bit libraries with 32bit Python?)")
pyogg.pyogg_error.PyOggError: The Opus library wasn't found or couldn't be loaded (maybe you're trying to use 64bit libraries with 32bit Python?)
>>> ctypes.util.find_library('opus')
>>>

Commenting out lines 104 and 105 eliminated this problem.

Additional Information

  • Termux on Android 11
  • libopus installed
  • libopusfile installed
  • libopusenc installed
  • PyOgg 0.7 (using latest github commit)
  • Python 3.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions