How can I load opus into my project?

AnonymousTRIAL

2 years ago

0 Replies

AnonymousTRIAL

2 years ago

6d04a904-1f49-4e55-be45-0dca8015a046


AnonymousTRIAL

a year ago

Hey there did you ever figure this out?

I'm having similar issue


AnonymousTRIAL

a year ago

c3f5da0b-9d78-4b00-a90b-421597c1f517


a year ago

what's opus


AnonymousTRIAL

a year ago

I think it's an audio processing library


AnonymousTRIAL

a year ago

I'm doing discord bot to process voice channel's input.


a year ago

you think?


AnonymousTRIAL

a year ago

Error stack:

ERROR:discord.ext.voice_recv.reader:Error processing rtp packet

Traceback (most recent call last):

File "/opt/venv/lib/python3.11/site-packages/discord/ext/voice_recv/reader.py", line 423, in callback

self.router.feed_rtp(_packet)

File "/opt/venv/lib/python3.11/site-packages/discord/ext/voice_recv/opus.py", line 77, in feed_rtp

decoder = self._get_decoder(packet.ssrc)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/opt/venv/lib/python3.11/site-packages/discord/ext/voice_recv/opus.py", line 72, in _get_decoder

decoder = self.decoders.setdefault(ssrc, PacketDecoder(self.sink, ssrc))

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/opt/venv/lib/python3.11/site-packages/discord/ext/voice_recv/opus.py", line 206, in __init__

self._decoder: Optional[Decoder] = None if sink.wants_opus() else Decoder()

^^^^^^^^^

File "/opt/venv/lib/python3.11/site-packages/discord/opus.py", line 420, in __init__

_OpusStruct.get_opus_version()

File "/opt/venv/lib/python3.11/site-packages/discord/opus.py", line 332, in get_opus_version

raise OpusNotLoaded()

a year ago

how do you install opus?


AnonymousTRIAL

a year ago

I don't know. I'm still trying to figure out why the script works locally, but not in Railway. This is currently the error stack.

I'm wondering opus is something natively installed in my computer but not in railway? But it shouldn't be if we're using virtualenv, right?


a year ago

probably a system library


AnonymousTRIAL

a year ago

sudo apt-get install libopus0

here's how to install it. can I add this to railway during build process? 🤔


AnonymousTRIAL

a year ago


a year ago

add a nixpacks.toml file to your project with this in it -

[phases.setup]
  aptPkgs = ['...', 'libopus0']

AnonymousTRIAL

a year ago

trying it out..


How can I load opus into my project? - Railway Help Station