What is best for Audio Playback? DirectSound or AudioVideoPlayback [C#]

Shaitan00

Well-known member
Joined
Aug 11, 2003
Messages
343
Location
Hell
Simply - I have just integrated SOUND into my game and encountered an amusing situation...

My first approach was via DIRECTSOUND, it requires some setting up but after that worked perfectly for my .WAV files. Problem is I also wanted to play MIDI files and I heard AudioVideoPlayback was able (which it is, sometimes)...

So I switched over and tried AudioVideoPlayback but to my surprise I found an odd delay/lag on the first time it is used (chokes on the first time I create an Audio via "Audio a = new Audio("Sounds\\Effects\\" + sSound, false); Audio.Play()")...

So, question is simple - which of the two are better for gaming purposes?
I dont care about effects and funky DirectX stuff, I just want to play WAV, MP3, and MIDI quickly and properly ...

So either I use DirectSound but figure out how to play MIDI files (and MP3 if possible) Or I use AudioVideoPlayback and find a way to fix the initial delay/lag... (if possible)...

(Is it just me or does "AudioVideoPlayback" seem much slower then "DirectSound"?)

So what do you guys, the Gamer / DirectX gurus think on this subject?
Thanks,
 
DirectSound is only meant for WAVE files/sounds and that is what it will play. It provides you with a great toolset for manipulation of sounds. Are you sure you cant use WAV files in your application? You would be able to achieve much greater effects and efficiency even if your application is very simple. AudioVideoPlayback is not supported anymore either (and it is also very basic), so it is very much a waste of developement time when looking from a future perspective.
 
Back
Top