Play from mp3

Hi, anyone can give me an example of playing a mp3 file from filePath with my discord bot using discord voice. Thanks
2 Replies
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Fyphen
Fyphen17mo ago
It's easy
const resource = await createAudioResource("your file path here", {
inputType: StreamType.WebmOpus,
metadata: {
title: "A good song!"
},
inlineVolume: true,
});

try {
player.play(resource);
} catch(err) {
console.log(err.stack);
}
const resource = await createAudioResource("your file path here", {
inputType: StreamType.WebmOpus,
metadata: {
title: "A good song!"
},
inlineVolume: true,
});

try {
player.play(resource);
} catch(err) {
console.log(err.stack);
}
@pablornc