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

Media Player Questions on the XBOX 360

Last post 6/5/2009 3:29 PM by dadoo Games. 3 replies.
  • 6/5/2009 9:11 AM

    Media Player Questions on the XBOX 360

    Ok, so I have just started deploying my project to the XBox 360 and while I was expecting a few problems I was not expecting to have this big a one with the Audio. Here is my problem:

    I have the Audio coded so that the background continues to loop when it grabs it from the list of songs and that works fine. However, my problem lies when I try to play a voice. Now, since both must use the MediaPlayer and you can only have 1 mp3 file playing at once I know that I must stop the previous song to play the voice. However, when I use:

    if (MediaPlayer.State == MediaPlayer.Stopped)
    {
       //resume song here
    }

    It causes the game to chug and never seems to understand if its playing or not. Now, if I use this on the PC it works fine. Is there a problem using the State of the MediaPlayer to check if its playing and if there is then is there a way that I can check if the sound clip is stopped without knowing the length of the sound file?  

  • 6/5/2009 2:48 PM In reply to

    Re: Media Player Questions on the XBOX 360

    Checking just about any MediaPlayer property every frame creates tons of garbage (which the 360 isn't great at handling) and threaded calls. See here. You need to check it less frequently or keep track of your state locally, without relying on the MediaPlayer queries.
    www.dadoogames.com
    Curling 2010 - in playtest soon, this month or next, this year for sure (maybe)
  • 6/5/2009 3:22 PM In reply to

    Re: Media Player Questions on the XBOX 360

    Thank you for your response and I actually do recall seeing that post earlier. I could try using the querie less often but I have the feeling that is still gunna make it chug. I should say, does anyone have a particular way to track a <Song> locally so that I could tell it has quit playing so I can cue the background music to continue?
  • 6/5/2009 3:29 PM In reply to

    Re: Media Player Questions on the XBOX 360

    My game is still soundless, so I can't help much there. You could try subscribing to the MediaPlayer events instead of continuously polling. There is a MediaPlayer.MediaStateChanged event that might be useful.
    www.dadoogames.com
    Curling 2010 - in playtest soon, this month or next, this year for sure (maybe)
Page 1 of 1 (4 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG