DirectSound problem!

Started by
6 comments, last by Gf11speed 24 years, 4 months ago
Make sure that the pointer you are calling the play method on is valid. I ran into a similar problem before when I first started playing around with DX and I was being a VERY BAD PROGRAMER and not checking my return codes. Every once in a while loading the wav files would fail for some reason and since I wasn't checking the app would just die later. No GPF (as you would expect) so it took me a little while to realize what was going on. Maybe this is your problem as well. I would say that nearly 80% of the DX problems I have seen and helped out on are a result of not checking the HRESULTs being returned.
Advertisement
Hmmm...
This happens to me, if I run a program like WinAmp in the Background.

(But i don't get any error MSGs)

The DirectSound creation will fail if there are another program which's using the sound card! It means you cannot use WinAmp, AVI with MCI, ... in background and your program (use directx) at the same time! Currently, if the DirectSound creation fail, I'll disable all my sound functions! Anyone else know how to continue using DirectSound in this case, please let me know.
My email is hdtuan@hotmail.com
What? From what I understand, DirectX should let multiple applications share
the same soundcard. It's the standard Windows MultiMedia library that only allows
one application to use the soundcard at a time.

What I mean is that when you change focus from one application to another,
the control to the soundcard should also transfer as well.

But, hmmm... you probably can't have a foreground program and a background program
trying to use the same soundcard under DirectX at the same time, so you're probably
right.

Reaver

[This message has been edited by Reaver (edited November 25, 1999).]

I don't get any errors while creating the DS-Object, etc.
(I think that's the strange thing)
But on my friend's machine my program works perfectly - i think that's because he's got a SB live that's got more wave interfaces (so he told me).
I've got a good old SB32...
Its pretty simple: You can't have two applications with the DirectSound object in EXCLUSIVE cooperative mode. By principle, exclusive means just for one. However, as long as your application can deal with another application having exclusive access (meaning you can't change the output settings) then you should just default to priority cooperative level.

- Splat

Does anyone know what would cause a program to just exit when trying to play a sound? In my game, the program just exits on the play sound command. The odd thing is, it only happens with some sounds! Not all. I have no idea what may be causing this, and I have worked at least 6-10 hours trying to figure it out. Help is appreciated! Thanks.
Greg FieldsSyntasoft Gameswww.syntasoft.comPost-Time Horse Racing (Available Now)
But I should get a Error MSG when I set the CoopLevel. I don't.
(But that's only with WinAmp or ModPlug Player).

This topic is closed to new replies.

Advertisement