コード例 #1
0
ファイル: MainPage.xaml.cs プロジェクト: prog76/Pacman
 void MainPage_Loaded(object sender, RoutedEventArgs e)
 {
     Uri uri = new Uri("files/111.mp3", UriKind.RelativeOrAbsolute);
      StreamResourceInfo sr = Application.GetResourceStream(uri);
      source = new WaveMediaStreamSource(sr.Stream);
      TestMediaElement.SetSource(source);
 }
コード例 #2
0
 private void Play(Stream DownloadedStream)
 {
     stream = new WaveMediaStreamSource(DownloadedStream);
     mediaElement.SetSource(stream);
     //mediaElement.Play();
     PauseIcon.Visibility = Visibility.Collapsed;
     PlayIcon.Visibility = Visibility.Visible;
 }
コード例 #3
0
ファイル: MainPage.xaml.cs プロジェクト: friuns2/emagine
 void OnDownloadComplete(object o, OpenReadCompletedEventArgs e)
 {
     try
     {
         System.IO.Stream stream = e.Result;
         WaveMediaStreamSource wave = new WaveMediaStreamSource(stream);
         this.Media.SetSource(wave);
         this.Media.Play();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }