R
Railway•2y ago
Diandrewun

How can I load opus into my project?

Solution:
add a nixpacks.toml file to your project with this in it -
[phases.setup]
aptPkgs = ['...', 'libopus0']
[phases.setup]
aptPkgs = ['...', 'libopus0']
...
Jump to solution
14 Replies
Percy
Percy•2y ago
Project ID: 6d04a904-1f49-4e55-be45-0dca8015a046
Diandrewun
DiandrewunOP•2y ago
6d04a904-1f49-4e55-be45-0dca8015a046
purnama
purnama•8mo ago
Hey there did you ever figure this out? I'm having similar issue c3f5da0b-9d78-4b00-a90b-421597c1f517
Brody
Brody•8mo ago
what's opus
purnama
purnama•8mo ago
I think it's an audio processing library I'm doing discord bot to process voice channel's input.
Brody
Brody•8mo ago
you think?
purnama
purnama•8mo 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()
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()
Brody
Brody•8mo ago
how do you install opus?
purnama
purnama•8mo 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?
Brody
Brody•8mo ago
probably a system library
purnama
purnama•8mo ago
sudo apt-get install libopus0 here's how to install it. can I add this to railway during build process? 🤔
purnama
purnama•8mo ago
Configuration File Reference | Nixpacks
App source + Nix packages + Docker = Image
Solution
Brody
Brody•8mo ago
add a nixpacks.toml file to your project with this in it -
[phases.setup]
aptPkgs = ['...', 'libopus0']
[phases.setup]
aptPkgs = ['...', 'libopus0']
purnama
purnama•8mo ago
trying it out..
Want results from more Discord servers?
Add your server