#Not receiving any audio from local .mp3

5 messages · Page 1 of 1 (latest)

scenic citrus
#

hey so i have this local .mp3 file, and i have this code right here

if (!interaction.member.voice?.channel) {
            return interaction.reply({ content: "You need to be in a Voice Channel to perform this command.", ephemeral: true })
        }

        const connection = joinVoiceChannel({
            channelId: interaction.member.voice.channel.id,
            guildId: interaction.guild.id,
            adapterCreator: interaction.guild.voiceAdapterCreator,
            selfDeaf: false
        })
            const player = createAudioPlayer()
            const resource = createAudioResource('./lofi/lofi_one.mp3')

                connection.subscribe(player)
                player.play(resource)
            return interaction.reply({ content: "Now playing: lofi_one.mp3" })

for some reason it isnt working, it will join the vc but wont play anything. and yes the file exists/does have audio.

rotund merlinBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

scenic citrus
#

discord.js v14 and node 17

solemn kraken
#

is that path relative to this js file's directory or the package root?

clear valve
#

For local files it‘s always advisable to use absolute file paths in AudioResource, too many things that can go wrong with relative.