#Debugging audio resources

5 messages · Page 1 of 1 (latest)

sharp forge
#

Could you add resource.playStream.on('error', console.log) after declaring resource and see if that logs anything?

neat edge
#

I asked this in #986520997006032896 a few days ago to no response, so im gonna ask it in this new audio channel

As soon as I load any audio file (using voice.createAudioResource()), resource.started shows false and resource.ended shows true. I can verify that the file exists.

I'm running it on the node:16-alpine Docker image

#
const resource = voice.createAudioResource(`${__dirname}/media/${songname}`);
const player = voice.createAudioPlayer();
connection.subscribe(player);
player.play(resource);
await new Promise((resolve, reject) => {
    const iv = setInterval(() => {
        console.log(resource.ended, empty, !resource.started)
        if (resource.ended || empty && !resource.started) {
            clearInterval(iv);
            resolve();
        };
    }, 1000);
});
connection.destroy();
``` outputs `true false true`