ThePedroo
ThePedroo
DIdiscord.js - Imagine ❄
Created by ThePedroo on 7/12/2023 in #djs-voice
djs/voice sending end if too slow to get data
I've gotten a persistent issue that, whenever I try to play (URL/online only!) something and it takes a bit longer to retrieve from the website, it already sends a end event. this could be fixed by maybe providing the ability to control whenever start/stopping sending packets (and will allow more things to be done without many issues) As long as it works.. it's fine
3 replies
DIdiscord.js - Imagine ❄
Created by ThePedroo on 5/21/2023 in #djs-voice
Won't play if source takes long to send more data
When trying to play a big stream, which the speed is 30kbps, I was getting an issue where djs voice would send a trackEnd even though the stream is 2h long, and I saw that in hosts with a better connection (my internet is 200mbps, can't be slow wifi) it would work properly The workaround I found was to use a setTimeout to 500ms, but I wonder if adding an option to add a length to the createAudioResource which it will only stop sending data when it finishes that length, and till it doesn't, it will wait next data. But I'd like to see how can I really fix this, since setTimeout isn't a good fix since will slowdown it whenever the source is fast or not Using latest sodium-native, discordjs/voice and discordjs/opus
3 replies
DIdiscord.js - Imagine ❄
Created by ThePedroo on 4/11/2023 in #djs-voice
Error & Not able to seek
I got a problem, I've been trying to search how I can seek an audio on discordjs/voice, found that it was with ffmpeg, okay, but I tried everything and it always stops after trying to seek.
And also, I got an error from discordjs/voice
file:///.../node_modules/@discordjs/voice/dist/index.mjs:1246
connection.setSpeaking(false);
^

TypeError: connection.setSpeaking is not a function
And also, I got an error from discordjs/voice
file:///.../node_modules/@discordjs/voice/dist/index.mjs:1246
connection.setSpeaking(false);
^

TypeError: connection.setSpeaking is not a function
My code is:
async filters(filters) {
this.config.filters = filters

const transcoder = new prism.FFmpeg({ args: [
'-analyzeduration', '0',
'-loglevel', '0',
'-f', 's16le',
'-ar', '48000',
'-ac', '2',
'-ss', '00:00:20'
] })

const stream = this.player.state.resource.playStream
const audioResource = djsVoice.createAudioResource(pipeline(stream, transcoder, () => {}), {
inputType: djsVoice.StreamType.Raw,
metadata: null,
inlineVolume: true
})

this.stop()

this.player.subscribe(this.player)
this.player.play(audioResource)

return this.config
}
async filters(filters) {
this.config.filters = filters

const transcoder = new prism.FFmpeg({ args: [
'-analyzeduration', '0',
'-loglevel', '0',
'-f', 's16le',
'-ar', '48000',
'-ac', '2',
'-ss', '00:00:20'
] })

const stream = this.player.state.resource.playStream
const audioResource = djsVoice.createAudioResource(pipeline(stream, transcoder, () => {}), {
inputType: djsVoice.StreamType.Raw,
metadata: null,
inlineVolume: true
})

this.stop()

this.player.subscribe(this.player)
this.player.play(audioResource)

return this.config
}
6 replies
DIdiscord.js - Imagine ❄
Created by ThePedroo on 3/12/2023 in #djs-voice
Connecting to voice connecting
Hi, I would like to know if it's possible to connect to the voice connection (to only send audio) only with the token, endpoint and sessionId, I don't have access to the bot token (this is how the project I'm doing works) and the client sends me those informations (as well with client id and etc) I couldn't find anywhere to do that, is that possible, if not, is there any other way to do it?
3 replies