[Openal] Mute when switch windows
Daniel PEACOCK
dpeacock at creativelabs.com
Wed Jul 18 10:25:01 PDT 2007
Hi Dave,
I think the behaviour in DSound that enables / disables a particular
DSBuffer to be heard when the application / window loses focus is the
DSBCAPS_GLOBALFOCUS flag which is part of the DSBUFFERDESC structure passed
to the CreateSoundBuffer function.
In OpenAL the Sources will continue to play and be audible regardless of
the whether the application has the "focus" or not. The solution we
recommend is to trap the WM_ACTIVATE message in your application (sent when
ever your application gains or loses the "focus") and either set the
Listener Gain to 0 (to mute all the Sources but allow them to continue to
play) or call alSourcePause on each Source. In the later case, your
application will need to know not to start any new sounds while it does not
have the focus.
Dan
Daniel Peacock
Custom Engineering Manager
Creative Labs, Inc.
email : dpeacock at creativelabs.com
phone : (408) 546 6552
Notice
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying or distribution of the message, or
any action taken by you in reliance on it, is prohibited and may be
unlawful. If you have received this message in error, please delete it
and contact the sender immediately. Thank you.
"Dave Shillito"
<dave.shillito at ku
ju.com> To
Sent by: <openal at opensource.creative.com>
openal-bounces at op cc
ensource.creative
.com Subject
[Openal] Mute when switch windows
07/18/2007 10:08
AM
Hi All,
I have just switched our app over from DirectSound to OpenAL.
In the DirectSound version of the app when we run windowed and switch
focus to a new window our sound would be muted. Now in the OpenAL
version the sound continues.
I think this was since I used "SetCooperativeLevel(hwnd,
DSSCL_PRIORITY)" in DirectSound.
Is it possible to recreate the DirectSound behaviour in OpenAL?
I was looking at alcSuspendContext & alcProcessContext, but was unclear
as to what would happen if the app continued to run - triggering sounds
in the background.
Cheers,
DAve
__________________________________________________________________________________________________________________________________________
Information contained in this e-mail is intended for the use of the
addressee only, and is confidential and may be the subject of Legal
Professional Privilege. Any dissemination, distribution, copying or use of
this communication without prior permission of the addressee is strictly
prohibited.The views of the author may not necessarily constitute the views
of Kuju Entertainment Ltd. Nothing in this email shall bind Kuju
Entertainment Ltd in any contract or obligation.
The contents of an attachment to this e-mail may contain software viruses
which could damage your own computer system. While Kuju Entertainment has
taken every reasonable precaution to minimise this risk, we cannot accept
liability for any damage which you sustain as a result of software viruses.
You should carry out your own virus checks before opening the attachment.
Registered Office : 10 Woodside Park, Catteshall Lane, Godalming, Surrey,
UK, GU7 1LG. Company Number : 3481384.Company Registered in England.
__________________________________________________________________________________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
_________________________________________________________________________________________________________________________________________
_______________________________________________
Openal mailing list
Openal at opensource.creative.com
http://opensource.creative.com/mailman/listinfo/openal
ForwardSourceID:NT000441FA
More information about the Openal
mailing list