mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-13 10:49:20 +00:00
🐛 fix: Stream crash
This commit is contained in:
@@ -339,15 +339,15 @@ export class DiscordMusicPlayerInstance {
|
|||||||
]);
|
]);
|
||||||
const streamFile = fs.createReadStream(`./temp/${track.id}.mp3`);
|
const streamFile = fs.createReadStream(`./temp/${track.id}.mp3`);
|
||||||
|
|
||||||
const stream = await playdl.stream(track.url);
|
//const stream = await playdl.stream(track.url);
|
||||||
stream.stream = streamFile;
|
const stream = streamFile;
|
||||||
|
|
||||||
Logger.verbose(
|
// Logger.verbose(
|
||||||
LOGGING_TAG,
|
// LOGGING_TAG,
|
||||||
`New stream created, type: ${stream.type}, url: ${track.url}, Guild: ${this.voiceChannel.guild.id}, VoiceChannel: ${this.voiceChannel.id}`
|
// `New stream created, type: ${stream.type}, url: ${track.url}, Guild: ${this.voiceChannel.guild.id}, VoiceChannel: ${this.voiceChannel.id}`
|
||||||
);
|
// );
|
||||||
|
|
||||||
resource = createAudioResource(stream.stream, {
|
resource = createAudioResource(stream, {
|
||||||
//inputType: stream.type
|
//inputType: stream.type
|
||||||
});
|
});
|
||||||
this.actualPlaybackURL = track.url;
|
this.actualPlaybackURL = track.url;
|
||||||
@@ -366,15 +366,15 @@ export class DiscordMusicPlayerInstance {
|
|||||||
]);
|
]);
|
||||||
const streamFile = fs.createReadStream(`./temp/${search.id}.mp3`);
|
const streamFile = fs.createReadStream(`./temp/${search.id}.mp3`);
|
||||||
|
|
||||||
const stream = await playdl.stream(search.url);
|
//const stream = await playdl.stream(search.url);
|
||||||
stream.stream = streamFile;
|
const stream = streamFile;
|
||||||
|
|
||||||
Logger.verbose(
|
// Logger.verbose(
|
||||||
LOGGING_TAG,
|
// LOGGING_TAG,
|
||||||
`New stream created, type: ${stream.type}, url: ${track.url}, Guild: ${this.voiceChannel.guild.id}, VoiceChannel: ${this.voiceChannel.id}`
|
// `New stream created, type: ${stream.type}, url: ${track.url}, Guild: ${this.voiceChannel.guild.id}, VoiceChannel: ${this.voiceChannel.id}`
|
||||||
);
|
// );
|
||||||
|
|
||||||
resource = createAudioResource(stream.stream, {
|
resource = createAudioResource(stream, {
|
||||||
//inputType: stream.type
|
//inputType: stream.type
|
||||||
});
|
});
|
||||||
this.actualPlaybackURL = search.url;
|
this.actualPlaybackURL = search.url;
|
||||||
@@ -385,7 +385,6 @@ export class DiscordMusicPlayerInstance {
|
|||||||
|
|
||||||
let timeout = 0;
|
let timeout = 0;
|
||||||
while (!resource.started && timeout < 10000) {
|
while (!resource.started && timeout < 10000) {
|
||||||
console.log('Waiting for resource to start');
|
|
||||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||||
timeout += 100;
|
timeout += 100;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user