Esempio n. 1
0
        private void ButtonBase2_OnClick(object sender, RoutedEventArgs e)
        {
            var msStream        = WebApiProxy.GetFile(@"http://win.web.nf01.sycdn.kuwo.cn/resource/n1/10/47/2323037830.mp3");
            var readFullyStream = new Framework.Recorder.ReadFullyStream(msStream);

            try
            {
                //var inputStream = new AudioFileReader(msStream);
                //var aggregator = new SampleAggregator(inputStream);

                //var waveOut = CreateWaveOut();
                ////waveOut.PlaybackStopped += OnPlaybackStopped;
                ////var volumeProvider = new VolumeWaveProvider16(bufferedWaveProvider);
                ////volumeProvider.Volume = volumeSlider1.Volume;
                //waveOut.Init(aggregator);
                //waveOut.Play();
            }
            catch (EndOfStreamException)
            {
                // reached the end of the MP3 file / stream
            }
            catch (WebException)
            {
                // probably we have aborted download from the GUI thread
            }
            catch (Exception)
            {
                // probably we have aborted download from the GUI thread
            }

            if (IsBufferNearlyFull)
            {
            }
        }