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

SoundBank.PlayCue() drops frames on 1st call

Last post 9/22/2009 8:06 PM by jwatte. 1 replies.
  • 9/22/2009 6:09 PM

    SoundBank.PlayCue() drops frames on 1st call

    A few XNA games will skip frames when a sound effect is played for the first time.  Usually causing death.  In Duality ZF, the first explosion sound drops a frame or two (except my engine refuses to let those frames play without being seen, so you never die from it).  How do I make sure all cues are loaded into memory?  Merely using SoundBank.GetCue() and then cue.Play() instead?
  • 9/22/2009 8:06 PM In reply to

    Re: SoundBank.PlayCue() drops frames on 1st call

    WaveBank and Cue have IsPrepared members, which will tell you whether they are ready to play. However, there is no explicit Prepare() function, so I guess you'll want to call GetCue() once for each cue in a sound bank when you load the sound bank, in an attempt to pre-prepare them, and then perhaps draw a progress bar until IsPrepared returns true.

    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
Page 1 of 1 (2 items) Previous Next