XACT Cue Playback Latency vs. DirectSound

I'm currently working on a piece of sound software that performs realtime quantizing based on eventual in-game actions. Since I need to play sounds on beat, it's important that the time from the Play() call is made on a buffer/cue to the time it actually starts coming out the speakers is very low.

XNA and XACT look like they're a great framework for making games. For the application I'm developing though, minimal sound playback latency is critical. Has anyone at Microsoft measured any additional overhead caused by using XACT over DirectSound (in either MDX, or C++ DX9)?

[603 byte] By [guile0] at [2008-2-20]
# 1

XACT on Windows XP has some additional latency on top of DirectSound. XACT has its own software mixer, and (on XP) it takes that output and streams it into a DirectSound buffer. So you have the additional latency from our 10ms "XACT audio frame" above what DirectSound would give you. Aside from that, there's not any real overhead for playing back in-memory sounds via XACT. Note that for streaming sounds, the latency can be larger. For a streaming sound, playback won't actually begin until the first time "DoWork" is called after the sound has been fully "Prepared". You can mimize the latency of a streaming sound by preparing the cue in advance, and then calling DoWork after you call Play().

I'd try a simple XACT test to see if it meets your latency requirements, and if not, go to DirectSound.

-Brian

BrianMS at 2007-10-8 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Audio / XACT...