Esempio n. 1
0
        private async void broadcastAudio(VideoInfo video)
        {
            Stream youtubeAudio    = new MemoryStream();
            var    audioDownloader = new AudioDownloader(video, null);

            audioDownloader.DownloadProgressChanged        += (sender, args) => Console.WriteLine(args.ProgressPercentage * 0.85);
            audioDownloader.AudioExtractionProgressChanged += (sender, args) => Console.WriteLine(85 + args.ProgressPercentage * 0.15);
            youtubeAudio = audioDownloader.ExecuteStream();
            using (youtubeAudio)
            {
                await mainTextChannel.SendMessage("**Now playing: " + video.Title + "**");

                sendAudioUsingDiscord(youtubeAudio);
            }
            return;
        }