Example #1
0
 private void StartTrack()
 {
     if (StreamingPlayer.StartPlayer())
     {
         icon_playPause_button.Kind = (MaterialDesignThemes.Wpf.PackIconKind)Enum.Parse(typeof(MaterialDesignThemes.Wpf.PackIconKind), "Pause");
         loadProgressTrackTimer.Start();
     }
 }
Example #2
0
        public static async Task <bool> UploadTrackAsync(Track track)
        {
            try {
                RequestTrackAudio requestTrackAudio = new RequestTrackAudio();
                requestTrackAudio.Filename = track.StoragePath;
                TrackAudio trackAudio = await Session.streamingServerConnection.streamingService.GetTrackAudioAsync(requestTrackAudio);

                byte[] bytes = trackAudio.Song;
                StreamingPlayer.StopPlayer();
                Mp3FileReader mp3Reader = new Mp3FileReader(new MemoryStream(bytes));
                waveStream = new WaveChannel32(mp3Reader);
                waveOutEvent.Init(waveStream);
                isTrackReady = true;
                StreamingPlayer.StartPlayer();
                return(true);
            } catch (Exception ex) {
                Console.WriteLine(ex);
                return(false);
            }
        }