diff options
author | Kobert-P <kassiaK@yahoo.de> | 2018-06-06 17:27:29 +0200 |
---|---|---|
committer | Kobert-P <kassiaK@yahoo.de> | 2018-06-06 17:27:29 +0200 |
commit | 8396bb48937889a708da7ecb35b788fcef4f2eca (patch) | |
tree | a943eada01951e6f2f3095facd087a48b3105c9b /DiscoBot/Audio/Voice.cs | |
parent | e541bd51f4dd1866129d764ca2fcfcde6240f22b (diff) | |
parent | 0b5fd9f180d9537f81f5dabf7692106a0127f849 (diff) |
Merge branch 'master' of https://github.com/TrueDoctor/DiscoBot
Diffstat (limited to 'DiscoBot/Audio/Voice.cs')
-rw-r--r-- | DiscoBot/Audio/Voice.cs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/DiscoBot/Audio/Voice.cs b/DiscoBot/Audio/Voice.cs index 84a221c..2c8f75e 100644 --- a/DiscoBot/Audio/Voice.cs +++ b/DiscoBot/Audio/Voice.cs @@ -18,7 +18,7 @@ { public static IAudioClient Client { get; set; } - public static void SendAsync(string path, int volume = 256) + public static void Send(string path, int volume = 256) { if (Client == null) { @@ -26,7 +26,7 @@ } // Create FFmpeg using the previous example - var ffmpeg = CreateStream(path, volume); + var ffmpeg = CreateStream(path, volume); var output = ffmpeg.StandardOutput.BaseStream; var barInvoker = new BackgroundWorker(); barInvoker.DoWork += delegate @@ -36,7 +36,7 @@ discord.FlushAsync(); }; - + barInvoker.RunWorkerAsync(); } @@ -66,10 +66,9 @@ if (Client != null) { - var wait = SoundEffects.Play(Sound.Nooo); + SoundEffects.Play(Sound.Nooo); await Client.StopAsync(); Client = null; - wait.Wait(); } } @@ -103,7 +102,7 @@ if (sc.Compare(path, tSound.ToString()) > SpellCorrect.ErrorThreshold) { - await Task.Run(() => Voice.SendAsync(path)); + await Task.Run(() => Voice.Send(path)); } await Task.Run(() => SoundEffects.Play(tSound)); |