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 User2y ago
Message Not Public
Sign In & Join Server To View
Fyphen
Fyphen2y 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
Want results from more Discord servers?
Add your server