Play audio from URL (mp3 stream)
Hey,
I'm currently using djs v14 and djs voice to create an Audio Player playing audio from a mp3 stream. Works fine in general.
However, after several minutes of playing the audio the Audio Player switches to Idle/disconnects without any error.
When I try reconnecting to the stream when it switches to the Idle state it works for another few minutes.
Any ideas?...
Converting opus to *.wav or *.mp3
Hello! I'm trying to receive audio and save as a *.wav or *.mp3 file. There is no documentation for this but I read some messages on discord. I tried a lot but still couldn't make it. After this code, I'm using ffmpeg to convert file. Like this:
```
ffmpeg -f s16le -y -ar 16000 -ac 1 -i test.pcm -ar 16000 -ac 1 test.wav
ffmpeg -f s16le -ar 48000 -ac 2 -i test.pcm test.mp3
ffmpeg -f s16le -ar 44.1k -ac 2 -i test.pcm test.wav...
Checking if a connection is already established.
Hey there, I was just wondering if I should be checking if the bot already has an established connection before running the below code:
```js
joinVoiceChannel({
channelId: channelId,
guildId: interaction.guild.id,...
Does PlayerSubscription automatically destroy if I call VoiceConnection.destroy()
Or do I need to
subscription.unsubscribe()
to prevent memory leaks, etcList of events emitted by AudioPlayer?
https://discord.js.org/#/docs/voice/stable/typedef/AudioPlayerEvents doesn't have any information
Where is this list of all events that AudioPlayer can emit?...
Headers Timeout Error
```js
TypeError: Cannot read properties of undefined (reading 'loadType')
at Object.run (C:\Users\rudei\lavamusic-2\src\slashCommands\Music\play.js:55:17)
at async Object.run (C:\Users\rudei\lavamusic-2\src\events\Client\interactionCreate.js:88:17)
ee [HeadersTimeoutError]: Headers Timeout Error...
ENOTFOUND a lot of times
Hey there, my bot get a lot of times the following error:
```
Error: getaddrinfo ENOTFOUND rotterdam1942.discord.media
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26)...
TypeError Cannot read properties of undefined (reading 'voice')
```js
const connection = joinVoiceChannel({
channelId: voiceChannel.id,
guildId: guild.id,
adapterCreator: guild.voiceAdapterCreator,...
How do you manually end an AudioReceiveStream?
It's very unclear from the documentation how you actually end it the same way you would with EndBehaviorType.AfterSilence or EndBehaviorType.AfterInactivity. How do I end it the same way it would end via EndBehaviorType.AfterSilence?
VoiceConnection always return undefined on discord.js V14
doesn't matter if the bot is connected to the channel or not, anyway i get undefined. On v13, everything is fine.
Bot joins vc but doesnt play nything
```js
import * as voice from '@discordjs/voice';
const player = voice.createAudioPlayer();
const resource = voice.createAudioResource('https://cdn.discordapp.com/attachments/810738582443917322/1010577980826849300/speech.mp3');
...
Very weird error from YTDL
I'm trying to play sound into my bot, and everything was going fine, until I changed NOTHING, and it started spewing out this error:
Transcription:
```evalmachine.<anonymous>:24
c[72],c[6]),(0,c[85])(c[11]),(0,c[41])(c[39],c[28],(0,c[66])()),(0,c[78])(c[Math.pow(6,2)+122+-119],c[new Date("Wednesday December 31 1969 19:00:14 CDT")/1E3])}catch(d){(0<c[0]||(((0,c[80])(c[60],c[88]),c[80])(c[21],c[88]),0))&&(0,c[17])((0,c[70])(c[6]),c[78],c[88],c[12])}try{2<c[91]&&(1<c[53]?(0,c[17])((0,c[80])(c[82],c[6]),c[78],c[39],c[5]):((0,c[45])(c[49],c[88]),c[78])(c[88],c[86])),(0,c[17])((0,c[85])(c[31]),c[41],c[88],c[75],(0,c[35])())}catch(d){}};Wka(ncode);...
bit won’t join voice channel
My bot won't join my voice channel, does anyone know why? there is no errors
``message.channel.send(
Playing ${args[1]}`);
var connection = joinVoiceChannel({
guildID: message.guild.id,...Bot won't join vc
My bot won't join my voice channel, does anyone know why? there is no errors
``message.channel.send(
Playing ${args[1]}`);
var connection = joinVoiceChannel({
guildID: message.guild.id,...