summaryrefslogtreecommitdiff
path: root/DiscoBot/Audio
diff options
context:
space:
mode:
authorTrueDoctor <d-kobert@web.de>2018-06-15 09:58:24 +0200
committerTrueDoctor <d-kobert@web.de>2018-06-15 09:58:24 +0200
commit380d9ec6048663b0e497e2437222d783236b864f (patch)
tree635fd93e6902c696abe31526da1fc15db7f2d516 /DiscoBot/Audio
parentc00b3bbf39ae2756aecceaa54b3a87a0e3955a9e (diff)
Added Properties Class
auto load last settings removed sound enumerable moved Sonds to properties moved Commands to properties
Diffstat (limited to 'DiscoBot/Audio')
-rw-r--r--DiscoBot/Audio/AudioModule.cs2
-rw-r--r--DiscoBot/Audio/Sound.cs21
-rw-r--r--DiscoBot/Audio/Soundeffects.cs26
-rw-r--r--DiscoBot/Audio/Voice.cs4
4 files changed, 37 insertions, 16 deletions
diff --git a/DiscoBot/Audio/AudioModule.cs b/DiscoBot/Audio/AudioModule.cs
index f2097b7..f8834f3 100644
--- a/DiscoBot/Audio/AudioModule.cs
+++ b/DiscoBot/Audio/AudioModule.cs
@@ -71,7 +71,7 @@ namespace DiscoBot.Audio
await _service.SendAudioAsync(Context.Guild, Context.Channel, song);
}
- SoundEffects.Play(tSound);
+ SoundEffects.Play(song);
}
}
} \ No newline at end of file
diff --git a/DiscoBot/Audio/Sound.cs b/DiscoBot/Audio/Sound.cs
new file mode 100644
index 0000000..174c076
--- /dev/null
+++ b/DiscoBot/Audio/Sound.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DiscoBot.Audio
+{
+ public class Sound
+ {
+ public Sound(string name, string url)
+ {
+ Name = name;
+ Url = url;
+ }
+
+ public string Name { get; }
+
+ public string Url { get; }
+ }
+}
diff --git a/DiscoBot/Audio/Soundeffects.cs b/DiscoBot/Audio/Soundeffects.cs
index 1e6dda1..317d0ff 100644
--- a/DiscoBot/Audio/Soundeffects.cs
+++ b/DiscoBot/Audio/Soundeffects.cs
@@ -5,7 +5,7 @@
using DiscoBot.Commands;
- public enum Sound
+ /*public enum Sound
{
Bell,
Ding,
@@ -17,45 +17,45 @@
Stupid,
Police,
Roblox
- }
+ }*/
public static class SoundEffects
{
public static int Volume { get; set; } = 50;
- public static void Play(Sound s)
+ public static void Play(string s)
{
string url = string.Empty;
int volume = 255;
switch (s)
{
- case Sound.Bell:
- case Sound.Ding:
+ case "Bell":
+ case "Ding":
url = "https://www.myinstants.com/media/sounds/boxing-bell.mp3";
break;
- case Sound.Finish:
+ case "Finish":
url = "https://www.myinstants.com/media/sounds/finishhim.swf.mp3";
break;
- case Sound.Magic:
+ case "Magic":
url = "https://www.myinstants.com/media/sounds/dream-harp-sound-effect.mp3";
break;
- case Sound.Monsterkill:
+ case "Monsterkill":
url = "https://www.myinstants.com/media/sounds/announcer_kill_monster_01.mp3";
break;
- case Sound.Nooo:
+ case "Nooo":
url = "https://www.myinstants.com/media/sounds/nooo.swf.mp3";
break;
- case Sound.Roblox:
+ case "Roblox":
url = "https://www.myinstants.com/media/sounds/roblox-death-sound_ytkBL7X.mp3";
break;
- case Sound.Stupid:
+ case "Stupid":
url = "https://www.myinstants.com/media/sounds/stupid_dum_03.mp3";
volume = 10;
break;
- case Sound.Police:
+ case "Police":
url = "https://www.myinstants.com/media/sounds/sound-of-the-police.mp3";
break;
- case Sound.Wrong:
+ case "Wrong":
url = "https://www.myinstants.com/media/sounds/wrong-answer-sound-effect.mp3";
volume = 50;
break;
diff --git a/DiscoBot/Audio/Voice.cs b/DiscoBot/Audio/Voice.cs
index 2c8f75e..5417560 100644
--- a/DiscoBot/Audio/Voice.cs
+++ b/DiscoBot/Audio/Voice.cs
@@ -66,7 +66,7 @@
if (Client != null)
{
- SoundEffects.Play(Sound.Nooo);
+ SoundEffects.Play("Nooo");
await Client.StopAsync();
Client = null;
}
@@ -105,7 +105,7 @@
await Task.Run(() => Voice.Send(path));
}
- await Task.Run(() => SoundEffects.Play(tSound));
+ await Task.Run(() => SoundEffects.Play(path));
}
private static Process CreateStream(string path, int vol = 256)