2017-09-04 27 views
0

我一直在試圖在我的控制檯應用程序上顯示文本,同時正在播放聲音文件,歌詞作爲示例。如何做到這一點?做...雖然System.Media.SoundPlayer()正在使用

struct Music 
{ 
     public 
      void PlaySong() { 
      System.Media.SoundPlayer player = new System.Media.SoundPlayer(); 
      player.SoundLocation = @"C:\Users\MyPC\Music\MoreMusic\songsample.wav"; 
      player.Load(); 
      player.PlaySync(); 
     } 
} 

class Program 
{ 


     static public void Main(string[] args) 
     { 
      Music music; 
      do 
      { 
       //Display Lyrics 
      } while (true); //as the song progresses 


     } 

} 
+0

你想要的歌詞流行起來,通過字同步同歌同戲詞?或者只是一次? – Werdna

+0

使用歌詞的例子,是的。隨着歌曲的進展,歌詞應該會彈出,也許在兩者之間有定時,但我得到了這部分內容的竅門。 –

+0

https://www.codeproject.com/Articles/89845/MP-CDG-Karaoke-Player – Werdna

回答

0

與播放更換PlaySync

struct Music 
{ 
     public 
      void PlaySong() { 
      System.Media.SoundPlayer player = new System.Media.SoundPlayer(); 
      player.SoundLocation = @"C:\Users\MyPC\Music\MoreMusic\songsample.wav"; 
      player.Load(); 
      player.Play(); 
     } 
}