Dispose pcm

This commit is contained in:
Master Kwoth 2017-07-05 11:23:31 +02:00
parent b4cf9fee84
commit 54a91b4a79

View File

@ -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);