我正在下载一个音频文件并将其存储在c#Wpf项目中的byte []中
byte[] audio = client.DownloadData(new Uri("http://static.sfdict.com/dictstatic/dictionary/audio/luna/E03/E0397400.mp3"))
我如何播放此声音文件。
答案 0 :(得分:1)
你可以这样做:
byte[] audio = client.DownloadData(new Uri("http://static.sfdict.com/dictstatic/dictionary/audio/luna/E03/E0397400.mp3"))
System.IO.Stream s = new MemoryStream(audio);
SoundPlayer player = new SoundPlayer(s);
player.Play();