VATICAN PSYCHO
VATICAN PSYCHO
DIAdiscord.js - Imagine an app
Created by VATICAN PSYCHO on 5/30/2024 in #djs-voice
Playing sounds from blob or URL
nvm, for some reason it started working.
6 replies
DIAdiscord.js - Imagine an app
Created by VATICAN PSYCHO on 5/30/2024 in #djs-voice
Playing sounds from blob or URL
node: 21.7.3, discord: 14.15.2
6 replies
DIAdiscord.js - Imagine an app
Created by VATICAN PSYCHO on 5/30/2024 in #djs-voice
Playing sounds from blob or URL
You mean blob.stream()?
6 replies
DIAdiscord.js - Imagine an app
Created by VATICAN PSYCHO on 5/30/2024 in #djs-voice
Playing sounds from blob or URL
My code:
const { data: blob, error } = await this.client.supabaseClient.storage.from("music").download("test.opus");

const arrayBuffer = await blob.arrayBuffer();
const buffer = Buffer.from(arrayBuffer);
const stream = Readable.from(buffer);
const connection = this.getConnection(interaction.guild, voiceChannel); // this get existing connection or create new


const resource = createAudioResource(stream, {
inputType: StreamType.Opus,
});

player.play(resource);
const { data: blob, error } = await this.client.supabaseClient.storage.from("music").download("test.opus");

const arrayBuffer = await blob.arrayBuffer();
const buffer = Buffer.from(arrayBuffer);
const stream = Readable.from(buffer);
const connection = this.getConnection(interaction.guild, voiceChannel); // this get existing connection or create new


const resource = createAudioResource(stream, {
inputType: StreamType.Opus,
});

player.play(resource);
6 replies