Exemple #1
0
        public Controls(SpotSharp.SpotSharp spotify)
        {
            Post["/play"] = x =>
            {
                spotify.Unpause();
                return HttpStatusCode.OK;
            };

            Post["/pause"] = x =>
            {
                spotify.Pause();
                return HttpStatusCode.OK;
            };

            Post["/next"] = x =>
            {
                spotify.PlayNextTrack();
                return HttpStatusCode.OK;
            };

            Post["/prev"] = x =>
            {
                spotify.PlayPreviousTrack();
                return HttpStatusCode.OK;
            };
        }
Exemple #2
0
        public Speak(SpotSharp.SpotSharp spotify)
        {
            Post["/speak"] = x =>
            {
                spotify.Pause();
                var speach = this.Bind<LinkModel>();
                var synthesizer = new SpeechSynthesizer
                {
                    Volume = 100,
                    Rate = -2
                };

                synthesizer.Speak(speach.Link);
                spotify.Play();
                return HttpStatusCode.OK;
            };
        }