You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jus try a basic example of creating a voice connection with joinVoiceChannel and get the connection with getVoiceConnection, and play any audio file like and .mp3, after that the player will enter in Buffering state and never will change to Playing. This exact code was tested on Node v20.13.1 and it works without any problem.
Another thing to point out, is that I also tested an .ogg file, with the createStream function, in that case the player state changes, but the audio doesn't play.
Code sample
constchannel=interaction.channel;if(!channel||!channel.isVoiceBased())return;constconnectionChannel=joinVoiceChannel({channelId: channel.id,guildId: (channelasVoiceBasedChannel).guild.id,adapterCreator: (channelasVoiceBasedChannel).guild.voiceAdapterCreator,});connectionChannel.on(VoiceConnectionStatus.Signalling,()=>{console.log("Connecting...");});connectionChannel.on(VoiceConnectionStatus.Ready,()=>{console.log("Player ready");});constspeechFile=path.resolve(process.cwd(),"speech.mp3");constconnection=getVoiceConnection(interaction.guildId!);if(!connection)return;constresource=createAudioResource(speechFile,{metadata: {title: "test"},});constplayer=createAudioPlayer();player.on(AudioPlayerStatus.Idle,()=>{console.log("Idle");});player.on(AudioPlayerStatus.Buffering,()=>{console.log("Buffering");});player.on(AudioPlayerStatus.Playing,()=>{console.log("Playing");});player.on("stateChange",(oldState,newState)=>{console.log(`Audio player transitioned from ${oldState.status} to ${newState.status}`);});player.on("error",(error)=>{console.error("Error:",error.message);});connection.subscribe(player);player.play(resource);
Versions
discordjs v14.5.2
Bun v1.1.8
Typescript v5.0.0
WSL 2 Fedora 38
@discordjs/voice Report
Core Dependencies
- @discordjs/voice: 0.17.0
- prism-media: 1.3.5
Opus Libraries
- @discordjs/opus: 0.9.0
- opusscript: not found
Encryption Libraries
- sodium-native: not found
- sodium: not found
- libsodium-wrappers: 0.7.13
- tweetnacl: not found
FFmpeg
- version: 6.0.1
- libopus: yes
Which package is this bug report for?
voice
Issue description
Jus try a basic example of creating a voice connection with
joinVoiceChannel
and get the connection withgetVoiceConnection
, and play any audio file like and.mp3
, after that the player will enter inBuffering
state and never will change toPlaying
. This exact code was tested on Node v20.13.1 and it works without any problem.Another thing to point out, is that I also tested an
.ogg
file, with thecreateStream
function, in that case the player state changes, but the audio doesn't play.Code sample
Versions
@discordjs/voice Report
Issue priority
Medium (should be fixed soon)
Which partials do you have configured?
No Partials
Which gateway intents are you subscribing to?
Guilds, GuildVoiceStates, GuildMessages, MessageContent
I have tested this issue on a development release
No response
The text was updated successfully, but these errors were encountered: