Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

197
Views
discordjs/voice not playing audio

I am trying to make a bot to play music, currently I am trying using a audio file on my computer which I know works as it plays when used with mpg123. The bot can join the voice channel but when this function is called it does not produce any sound, does anyone have any suggestions?

const { joinVoiceChannel, createAudioPlayer, createAudioResource } = require('@discordjs/voice');

...

function play(connection, messageCreate, server) {
    let resource = createAudioResource(__dirname + '/try.mp3', { inlineVolume : true });
    const player = createAudioPlayer();
    connection.subscribe(player);
    player.play(resource, {seek: 0, volume: 1.0});
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The most likely problem I can think of is a common one: you need the GUILD_VOICE_STATES intent for your bot the join a voice channel. If you don't have it, it'll show up as having joined, but actually still be in the signalling state which prohibits it from doing anything.

If you do have that intent already, or adding it did not solve your problem, consider debugging your dependencies with the method outlined here.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!