Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

jjmontes

Is any sound playing? Need help!

This topic is 5984 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need to know if the sound card is playing any sound, but I haven''t seen any function in DirectSound8 that allows me to know that. Maybe I have to look into the sound buffer but... can I access it? Note: the sound isn''t be produced by my application, of course. What I wan''t to do is to know if any application is playing sound. Any help would be apreciated, thanks!

Share this post


Link to post
Share on other sites
Advertisement
You might to check out the SDK docs on this. Under IDirectSoundBuffer8, I found the following:


  
IDirectSoundBuffer8::GetStatus
The GetStatus method retrieves the status of the sound buffer.

Syntax

HRESULT GetStatus(
LPDWORD pdwStatus
);

Parameters

pdwStatus

Address of a variable to contain the status of the sound buffer. The status can be a combination of the following flags:

Value Description
DSBSTATUS_BUFFERLOST The buffer is lost and must be restored before it can be played or locked.

DSBSTATUS_LOOPING The buffer is being looped. If this value is not set, the buffer will stop when it reaches the end of the sound data. This value is returned only in combination with DSBSTATUS_PLAYING.

DSBSTATUS_PLAYING The buffer is playing. If this value is not set, the buffer is stopped.

DSBSTATUS_LOCSOFTWARE The buffer is playing in software. Set only for buffers created with the DSBCAPS_LOCDEFER flag.

DSBSTATUS_LOCHARDWARE The buffer is playing in hardware. Set only for buffers created with the DSBCAPS_LOCDEFER flag.

DSBSTATUS_TERMINATED The buffer was prematurely terminated by the voice manager and is not playing. Set only for buffers created with the DSBCAPS_LOCDEFER flag.


Return Values

If the method succeeds, the return value is DS_OK.

If the method fails, the return value may be DSERR_INVALIDPARAM.

Requirements

Header: Declared in dsound.h.

See Also

IDirectSoundBuffer8





Jim Adams
home.att.net/~rpgbook
Author, Programming Role-Playing Games with DirectX


[edited by - jim adams on June 2, 2002 4:44:11 PM]

Share this post


Link to post
Share on other sites
I know that, but that only tells me about the sound buffers
that my app has created. I even tried to get the primary sound
buffer and use that methods, even reading it to see if there is
wave data, but to do that I need the directsound object in
exclusive mode so other apps can't write on it.

The point is that DirectX/Windows are preventing me to see what
other applications are doing with the sound card, which can be
great in most cases but now it is fucking me. As with
other 'strange-things-not-usually-done', the documentation on
this is null.

So, if anyone knows... I've tried everything I could: every
combination of cooperative modes, accessing the primary buffer,
reading its state, its contents... But I'm sure it can be done,
because some soundcard mixers show a bar with the actual volume
in the wave output.

Thanks anyway for the answer.

[edited by - jjmontes on June 2, 2002 2:42:03 PM]

Share this post


Link to post
Share on other sites
The DirectSound object will only report on it''s own doings, not those of the system, so you''ll need to turn to Win32 SDK.

MSDN LIbrary > Platform SDK > Graphics and Multimedia Services > Multimedia Audio > Audio Mixers

Look for meters.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!