summaryrefslogtreecommitdiff
path: root/DiscoBot/Audio/Soundeffects.cs
blob: 7e5e91851be4afcf5d7e60923c5a4f60b2964725 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
namespace DiscoBot.Audio
{
    using System;
    using System.Threading.Tasks;

    using DiscoBot.Commands;

    public enum Sound
    {
        Bell,
        Ding,
        Nooo,
        Monsterkill,
        Finish,
        Wrong,
        Magic,
        Stupid,
        Police,
        Roblox
    }

    public static class SoundEffects
    {
        public static int Volume { get; set; } = 50;

        public static async Task Play(Sound s)
        {
            string url = string.Empty;
            int volume = 256;
            switch (s)
            {
                case Sound.Bell:
                case Sound.Ding:
                    url = "https://www.myinstants.com/media/sounds/boxing-bell.mp3";
                    break;
                case Sound.Finish:
                    url = "https://www.myinstants.com/media/sounds/finishhim.swf.mp3";
                    break; 
                case Sound.Magic:
                    url = "https://www.myinstants.com/media/sounds/dream-harp-sound-effect.mp3";
                    break;
                case Sound.Monsterkill:
                    url = "https://www.myinstants.com/media/sounds/announcer_kill_monster_01.mp3";
                    break;
                case Sound.Nooo:
                    url = "https://www.myinstants.com/media/sounds/nooo.swf.mp3";
                    break;
                case Sound.Roblox:
                    url = "https://www.myinstants.com/media/sounds/roblox-death-sound_ytkBL7X.mp3";
                    break;
                case Sound.Stupid:
                    url = "https://www.myinstants.com/media/sounds/stupid_dum_03.mp3";
                    volume = 10;
                    break;
                case Sound.Police:
                    url = "https://www.myinstants.com/media/sounds/sound-of-the-police.mp3";
                    break;
                case Sound.Wrong:
                    url = "https://www.myinstants.com/media/sounds/wrong-answer-sound-effect.mp3";
                    volume = 50;
                    break; 
            }

            volume = (int)(volume * (Volume / 100.0));


            if (url != string.Empty)
            {
                // await Dsa.Service.SendAudioAsync(url, vol);
                Voice.SendAsync(url, volume);
                return;
            }

            throw new Exception("Ton Existiert nicht");
        }
    }
}