我想使用MediaPlayer
对象播放一首背景歌曲。一切都很好,直到我尝试启动该程序。
我见过人们只使用两行代码来播放歌曲,这就是我在LoadContent
方法中所做的:
Song song = Content.Load<Song>("song");"song_title"
MediaPlayer.Play(song_title);
我错了
Microsoft.Xna.Framework.Content.ContentLoadException was unhandled
HResult=-2146233088
Message=Error loading "song". File contains Microsoft.Xna.Framework.Audio.SoundEffect but trying to load as Microsoft.Xna.Framework.Media.Song.