mp3

hello i have a mp3 file how to make the bot play that file ?
13 Replies
d.js toolkit
d.js toolkit12mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
d.js docs
d.js docs12mo ago
guide Library: Audio Resources read more
Enkeedo
EnkeedoOP12mo ago
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});
const player = createAudioPlayer();
response.data.pipe(fs.createWriteStream("./interactions/slash/voice/test.mp3"));

let resource = createAudioResource(join(__dirname, 'test.mp3'));
connection.subscribe(player);
player.play(resource);
player.on(AudioPlayerStatus.Idle, () => {
connection.destroy();
});
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});
const player = createAudioPlayer();
response.data.pipe(fs.createWriteStream("./interactions/slash/voice/test.mp3"));

let resource = createAudioResource(join(__dirname, 'test.mp3'));
connection.subscribe(player);
player.play(resource);
player.on(AudioPlayerStatus.Idle, () => {
connection.destroy();
});
this is the code and it dose not work @Qjuh you mean like this ?
let resource = createAudioResource(response.data.pipe());
let resource = createAudioResource(response.data.pipe());
oh yeah it is didnt work https://api.elevenlabs.io/v1/text-to-speech/knrPHWnBmmDHMoiMeP3l/stream
Enkeedo
EnkeedoOP12mo ago
ElevenLabs
Streaming - ElevenLabs
Converts text into speech using a voice of your choice and returns audio as an audio stream.
Enkeedo
EnkeedoOP12mo ago
i have it so should be
player.play(response.data);
player.play(response.data);
then ? what is the second parameter dogeHaHa
let resource = createAudioResource(response.data, {
inputType: StreamType.Arbitrary
});
let resource = createAudioResource(response.data, {
inputType: StreamType.Arbitrary
});
like this ? @Qjuh im sorry but im dumb
Enkeedo
EnkeedoOP12mo ago
No description
Enkeedo
EnkeedoOP12mo ago
bruh my bad i installed it
let resource = createAudioResource(
response.data, {
inputType: StreamType.Arbitrary
}
);
let resource = createAudioResource(
response.data, {
inputType: StreamType.Arbitrary
}
);
FeelsBadMan any last helps ? @Qjuh i know that im so dumb dogeHaHa sry
Enkeedo
EnkeedoOP12mo ago
No description
d.js docs
d.js docs12mo ago
guide Getting Started: Introduction - Installation > Extra Dependencies read more
Enkeedo
EnkeedoOP12mo ago
No description
Enkeedo
EnkeedoOP12mo ago
done
Enkeedo
EnkeedoOP12mo ago
No description
Enkeedo
EnkeedoOP12mo ago
dogeHaHa did this
npm install --global --production --add-python-to-path
npm install --global --production --add-python-to-path
say that im dumb its okay i will FeelsBadMan
Want results from more Discord servers?
Add your server