Closed paddatrapper closed 3 years ago
Thanks for your feedback.
Could you please provide a bit more information about the code that generates the error? A minimal example would be ideal.
Also, have you looked at the example 03-write-ogg-opus.py? That shows usage of OpusBufferedEncoder which (internally) uses OpusEncoder.
Cheers,
Matthew
A minimal example:
$ python3
Python 3.9.1+ (default, Jan 10 2021, 15:42:50)
[GCC 10.2.1 20201224] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyogg import OpusEncoder
>>> encoder = OpusEncoder()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/kyle/projects/bitcast/mumbleice/pyenv/lib/python3.9/site-packages/pyogg/opus_encoder.py", line 20, in __init__
self.set_max_bytes_per_frame(4000)
File "/home/kyle/projects/bitcast/mumbleice/pyenv/lib/python3.9/site-packages/pyogg/opus_encoder.py", line 128, in set_max_bytes_per_frame
self._max_bytes_per_frame = opus.opus_int32(max_bytes)
AttributeError: module 'pyogg.opus' has no attribute 'opus_int32'
>>>
Thanks for that. I’ll have a look on Monday and get back to you.
Matthew
Found the error - I was missing libopusfile0
. There should probably be better error handling here to report missing external libraries if the features that require them are used
Thanks for reporting back on the cause of the error.
I have committed changes to master that improve the exception messages when OpusFile is missing. Would you like to confirm that they work as expected for you?
Also, your minimal example should now no longer error at all, given that it shouldn't have depended on OpusFile in the first place. Again, would you be so kind as to double-check these changes for me?
Cheers,
Matthew
Yup, that works. Thanks!
I'm unable to import
OpusEncoder
using the current master (3783343):