Dispose pcm
This commit is contained in:
parent
b4cf9fee84
commit
54a91b4a79
@ -180,7 +180,6 @@ namespace NadekoBot.Services.Music
|
||||
// i don't want to spam connection attempts
|
||||
continue;
|
||||
}
|
||||
pcm = ac.CreatePCMStream(AudioApplication.Music, bufferMillis: 500);
|
||||
OnStarted?.Invoke(this, data);
|
||||
|
||||
byte[] buffer = new byte[3840];
|
||||
@ -215,6 +214,7 @@ namespace NadekoBot.Services.Music
|
||||
var flushDelay = Task.Delay(1000, flushToken);
|
||||
await Task.WhenAny(flushDelay, pcm.FlushAsync(flushToken));
|
||||
flushCancel.Cancel();
|
||||
pcm.Dispose();
|
||||
}
|
||||
|
||||
OnCompleted?.Invoke(this, data.Song);
|
||||
|
Loading…
Reference in New Issue
Block a user