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
}
2 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
ThePedroo
ThePedrooOP2y ago
"dependencies": {
"@discordjs/opus": "^0.9.0",
"@discordjs/voice": "^0.15.0",
"libsodium-wrappers": "^0.7.11",
"prism-media": "^1.3.5"
}
"dependencies": {
"@discordjs/opus": "^0.9.0",
"@discordjs/voice": "^0.15.0",
"libsodium-wrappers": "^0.7.11",
"prism-media": "^1.3.5"
}
Got rid of the error by removing this.stop(), but then I get premature error.. Yeah, and I got this working, but with some issues, when it takes a little longer to set the filter, it ends it And can I re-use the stream from playStream to set the filters there and play again? Oh yeah, thanks, I fixed that before saying those above and didn't see
Want results from more Discord servers?
Add your server