Playing sounds from blob or URL

I'm trying to integrate my bot with SupaBase. I tried using passing to createAudioResource either URL to to that resource or passing blob but it's not working.
2 Replies
d.js toolkit
d.js toolkit6mo 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
VATICAN PSYCHO
VATICAN PSYCHOOP6mo ago
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);
You mean blob.stream()? node: 21.7.3, discord: 14.15.2 nvm, for some reason it started working.
Want results from more Discord servers?
Add your server