【发布时间】:2010-11-29 22:26:30
【问题描述】:
我目前正在开发一款 XNA 游戏,但是当我命令它播放 mp3 文件时,如果我的文件不受 DRM 保护,则会引发 DRM 错误。谁能向我解释为什么会这样?
public class SoundEffects : GameComponent
{
private Song explosion;
private Song thunder;
public SoundEffects(Game game):base(game)
{
explosion = Game.Content.Load<Song>("explosion");
thunder = Game.Content.Load<Song>("thunder");
}
/*protected override void LoadContent()
{
explosion = Game.Content.Load<Song>("explosion"); // Put the name of your song in instead of "song_title"
thunder = Game.Content.Load<Song>("thunder"); // Put the name of your song in instead of "song_title"
}*/
public void playMusicThunder()
{
MediaPlayer.Play(thunder);
}
public void playMusicExplosion()
{
MediaPlayer.Play(this.explosion);
}
【问题讨论】:
-
你为什么用
Song做音效?为什么不使用SoundEffect?