mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 17:43:30 +01:00
19 lines
403 B
JavaScript
19 lines
403 B
JavaScript
const BasePlayer = require('./BasePlayer');
|
|
const fs = require('fs');
|
|
|
|
class DefaultPlayer extends BasePlayer {
|
|
|
|
playFile(file) {
|
|
return this.playStream(fs.createReadStream(file));
|
|
}
|
|
|
|
playStream(stream) {
|
|
this._shutdown();
|
|
const pcmStream = this.convertStream(stream);
|
|
const dispatcher = this.playPCMStream(pcmStream);
|
|
return dispatcher;
|
|
}
|
|
}
|
|
|
|
module.exports = DefaultPlayer;
|