XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

MediaPlayer Class, very low performance?

Last post 01/06/2009 10:40 by Stylish. 2 replies.
  • 30/05/2009 14:56

    MediaPlayer Class, very low performance?

    Hello,

    Im trying to add sound in my game, but when I load a music as Song, if I play it, the fps of my game slowdowns to 2 fps... In pseudcode:

    if music is not playing
    music play


    If I load it as SoundEffect, everything goes well, but  I dont have a method to stop the sound...

    It is normal? Thanks in advance..
  • 30/05/2009 23:07 In reply to

    Re: MediaPlayer Class, very low performance?

    Some of the media state properties are quite slow to query, so if you are checking the current play status every frame, that could slow you down pretty dramatically. It would be more efficient to just keep track of whether you have already started a song playing, rather than constantly polling the player status.
    XNA Framework Developer - blog - homepage
  • 01/06/2009 10:40 In reply to

    Re: MediaPlayer Class, very low performance?

    Thank you very much. I will give it a try :)
Page 1 of 1 (3 items) Previous Next