Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

209
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda