DSBCAPS_TRUEPLAYPOSITION

Last post 03-13-2008, 5:18 PM by Dugan. 1 replies.
Sort Posts: Previous Next
  •  02-26-2008, 12:50 PM

    DSBCAPS_TRUEPLAYPOSITION

    Can anyone explain what this flag (for DirectSound buffer creation) actually does?

    The docs say:

    "Force IDirectSoundBuffer8::GetCurrentPosition to return the buffer's true play position. This flag is only valid in Windows Vista."

    So what does that mean I get when I call GetCurrentPosition if I _don't_ set this flag, and/or what functionality am I missing in XP (this flag causes buffer creation to fail in XP)?

    Supposedly the flag DSBCAPS_GETCURRENTPOSITION2 actually does the same thing:

    "Now, if the DSBCAPS_GETCURRENTPOSITION2 flag is specified, the application can get a more accurate play cursor."

    So what's the difference between these flags?

    Also, a quick word to the XNA forums designer... someone might think about changing the box labeled "go" to "search"; it's really not obvious how to _search_ the forum, since the word "search" doesn't appear anywhere at forums.xna.com, except for the link pointing back to the old MSDN forums.

    Thanks!

    -Dan
  •  03-13-2008, 5:18 PM

    Re: DSBCAPS_TRUEPLAYPOSITION

    DSBCAPS_GETCURRENTPOSITION2 is a flag that was added many years ago to make GetCurrentPosition behave correctly (or at least more intuitively) without breaking existing apps that relied on the original GetCurrentPosition behavior.  The guideline today is that all apps should always use DSBCAPS_GETCURRENTPOSITION2.

    DSBCAPS_TRUEPLAYPOSITION is a flag we added in Windows Vista that makes DSound report play cursor positions that increase more smoothly, for backwards compatibility with older media applications.  As a side effect of Vista's new software-only audio stack, by default DSound reports play cursors that increase in regular 10ms jumps.  The vast majority of applications work fine with this, but certain media players can glitch if the play cursor doesn't update smoothly.  If your app works OK without DSBCAPS_TRUEPLAYPOSITION, we don't recommend using it.

    Hope that helps,
    Dugan Porter - Game Audio Developer - Microsoft


    Dugan Porter [MS]
    Game Audio Team
View as RSS news feed in XML
©2007 Microsoft Corporation. All rights reserved. Privacy Statement Terms of Use Code of Conduct Feedback