Audio not playing

Hey - I followed the guide for playing audio but nothing is playing for some reason
6 Replies
d.js toolkit
d.js toolkit5mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
duck
duck5mo ago
- Show your code!
Freud
FreudOP5mo ago
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
})

const player = createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Pause,
},
});

const music = createAudioResource('/music/yes.mp3')

player.play(music)
connection.subscribe(player)

player.on(AudioPlayerStatus.Playing, () => {
// console.log(music);

console.log('The audio player has started playing!');
});
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
})

const player = createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Pause,
},
});

const music = createAudioResource('/music/yes.mp3')

player.play(music)
connection.subscribe(player)

player.on(AudioPlayerStatus.Playing, () => {
// console.log(music);

console.log('The audio player has started playing!');
});
For some reason when I log music it thinks duration is 0
duck
duck5mo ago
that path probably isn't resolving to the path you think it's resolving to consider using an absolute path (or at the very least resolving one yourself using the path module)
Freud
FreudOP5mo ago
okay thanks!
Want results from more Discord servers?
Add your server