#I'm trying to play audio from stream

1 messages · Page 1 of 1 (latest)

mortal pewter
#

I've installed discord-py-interactions[voice] but when trying to play audio from stream I get error Could not find opus library.

Relevant part of code:

audio_source = AudioVolume("https://emisja.radio17.pl/stream")
            await vc.voice_state.play(audio_source)
static raftBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

balmy ibex
#

Once you have done that, that error should go away if it was related to the deps missing

balmy ibex
#

I was able to use that url you have provided to successfully play music

from interactions import Client, listen, slash_command, events, InteractionContext
from interactions.api.voice.audio import AudioVolume

bot = Client(
    debug_scope=780435741650059264,
    delete_unused_application_cmds=True,
)

@slash_command(name="play", description="Play a song")
async def play(ctx: InteractionContext):
    vc = ctx.author.voice.channel
    voice_state = await vc.connect()
    audio_source = AudioVolume("https://emisja.radio17.pl/stream")
    await voice_state.play(audio_source)

bot.start("token")
cerulean quiver
#

the error is because you dont have opus installed, nothing to do with pynacl

(pynacl is a libsodium fork which handles cryptography and networking, opus handles audio en/de coding)

#

what os are you using, @mortal pewter

mortal pewter
mortal pewter
cerulean quiver
#

huh, we package opus with the library for windows

mortal pewter
#

I can try nuking my venv later today and reinstalling the whole lib.

cerulean quiver
#

if you could, as i can see opus in the lib rn

#

ah i see the issue

#

its not being packaged in the pypi release

#

thatll be resolved in the next pypi release

mortal pewter
#

Ty for quick fix/response.

cerulean quiver
#

np

#

if you install from git it will work - 5.1.0 should be out in a few days