discord.js - Imagine an app

DIA

discord.js - Imagine an app

Support server for discord.js, a Node.js module to interact with Discords apps API.

Join

djs-questions

djs-voice

How do you write an mp3 or playable file when getting voice-input from an user

```JS let receiver = connection.receiver let stream receiver.speaking.on("start", userid => { let user = client.users.cache.get(userid)...

Is there a way to specify encoder args when playing audio

For example -af bass=g=10,dynaudnorm=f=200

Offset out of bounds

I worked out a radio bot for (many guilds) but while starting the bot it creates a voice player for every guild and while doing this it returns the error seen in title. If anyone knows why this happens, pls lemme know.

How can I make a custom adapter for djs voice

I'm writing a client library for discord and want to use djs voice for voice support

Get AudioPlayer

How would I go about getting the AudioPlayer now that connection.state.subscription.stop() is no longer a thing?

Check if bot is in voice channel

How would you check if the bot is in a voice channel? getVoiceChannel() isn't working for me if the connection is not subscribed to a player...

How to seek to a point in audio timeline?

How can I jump to a point in audio like many music bots do??

Bot does not play audio when audio source is changed from stream to string URL

For some strange reason, when I have my bot change from playing a ReadableStream to playing from a URL in a string, the bot does not play anything. I will note, that when I start the bot playing from a URL string, it works just fine, and when I change the source to a ReadableStream, it works just fine. This issue only occurs when switching from a ReadableStream into a URL string. I've analyzed my code to make sure that there is actual playable audio and I've also checked that the audio resources...

get volume

i cant find the place in the docs that talks about volume, ive seen code like volume.setVolume(0.2); but cant find setVolume. https://discord.js.org/#/docs/voice/main/class/AudioResource?scrollTo=volume this page talks about volume, but not any of its submethods or anything, no link...

Audio not playing

```js const Discord = require("discord.js") const { Server, RCON, MasterServer } = require('@fabricio-191/valve-server-query'); const { joinVoiceChannel } = require("@discordjs/voice") const { createAudioPlayer } = require('@discordjs/voice');...

How to properly restart a voice connection after bot restart?

So lets say I restart my bot but I want all voice connections that my bot was in before the restart to be reconnected. What is the best way to do this? Does it involve using the voice sessionId?

Replaying spoken audio

I tried creating a bot that reacts to any message I send and then it should join a voice channel and repeat whatever I say. It does pick up that I speak stuff, no errors in the console, all I realized is that it switches from buffering to playing and then from playing to autopaused immediately. I guess it has something to do with the stream not continuously refreshed and read but I'm very new to streams, especially audio streams and I'm not sure on what to do. I made a reddit post according to this as well but never got a response. I have pastebin over here: https://pastebin.com/gft1WkVn I have imported everything that's needed, everything is pretty much up to date and all intents have been given as well (guilds, guild msgs and guild voicestate)...

bot finished playing

How to understand that a bot has finished playing a file to start a new one?

Cannot play audio as no valid encryption package is installed

I literally have sodium, libsodium and libsodium-wrappers installed and yet it still throws this damn error. ```haskell Error: Cannot play audio as no valid encryption package is installed. - Install sodium, libsodium-wrappers, or tweetnacl. - Use the generateDependencyReport() function for more information....

Getting existing audio player

how do i get the audio player in a guild if any?

aborted error

i get this error:
[Uncaught Exception] :
Error: aborted
Origin: uncaughtException
[Uncaught Exception] :
Error: aborted
Origin: uncaughtException
after at around 3 minutes when the bot is playing music in a voice channel...

volume

hwo do i increase/decrease the volume of bot in a voice channel? doing <Resource>.volume.setVolume() changes the volume but it's like chnages the bass of the sound and not the actual volume...

Volume

How do i get the current volume of the bot?

not joining voice channel

```js const { Client, GatewayIntentBits } = require('discord.js'); const { joinVoiceChannel } = require('@discordjs/voice'); const client = new Client({ intents: [...

Getting amplitude value from pcm stream

Hey guys. I am trying to get an amplitude value from my live pcm stream but very stuck. Code below