Is any sound playing? Need help!
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!
You might to check out the SDK docs on this. Under IDirectSoundBuffer8, I found the following:
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]
IDirectSoundBuffer8::GetStatusThe GetStatus method retrieves the status of the sound buffer.SyntaxHRESULT GetStatus( LPDWORD pdwStatus );ParameterspdwStatusAddress 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 ValuesIf 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]
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]
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]
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.
MSDN LIbrary > Platform SDK > Graphics and Multimedia Services > Multimedia Audio > Audio Mixers
Look for meters.
Thank you very very very very much.
Real programers are not afraid from maths! (I am)
(from an Asfixia Member I think)
JJpRiVaTe (Private Zone)
Real programers are not afraid from maths! (I am)
(from an Asfixia Member I think)
JJpRiVaTe (Private Zone)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement