【问题标题】:XNA SOUND Playing problemXNA SOUND 播放问题
【发布时间】: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

标签: xna xna-4.0


【解决方案1】:

如果您在设备通过 Zune 连接到 PC 时尝试播放歌曲文件,则会引发异常 (DRM)。您可以在断开设备连接后测试游戏,或者使用 WPconnect 工具(我相信是在 10 月的 WPDT 更新中)代替 Zune 来测试游戏

【讨论】:

    猜你喜欢
    • 2013-04-05
    • 1970-01-01
    • 2011-08-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-06
    • 2020-12-30
    相关资源
    最近更新 更多