From 4ca7291ebee440d9f3ef2a1643d8d01b29006459 Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Mon, 9 Apr 2018 13:13:54 +0200 Subject: Added FileHandler to enable sending heros via Discord --- DiscoBot/Commands/Voice.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'DiscoBot/Commands/Voice.cs') diff --git a/DiscoBot/Commands/Voice.cs b/DiscoBot/Commands/Voice.cs index 72988d4..02210e8 100644 --- a/DiscoBot/Commands/Voice.cs +++ b/DiscoBot/Commands/Voice.cs @@ -39,10 +39,10 @@ [Command("play")] public Task PlayAudioAsync(string path) { - return this.SendAsync(Client, path); + return SendAsync(path); } - private Process CreateStream(string path) + private static Process CreateStream(string path) { var ffmpeg = new ProcessStartInfo { @@ -54,12 +54,12 @@ return Process.Start(ffmpeg); } - private async Task SendAsync(IAudioClient client, string path) + private static async Task SendAsync(string path) { // Create FFmpeg using the previous example - var ffmpeg = this.CreateStream(path); + var ffmpeg = CreateStream(path); var output = ffmpeg.StandardOutput.BaseStream; - var discord = client.CreatePCMStream(AudioApplication.Music); + var discord = Client.CreatePCMStream(AudioApplication.Music); await output.CopyToAsync(discord); await discord.FlushAsync(); } -- cgit v1.2.3-70-g09d2