1. 'birdtwitter.wav'

Bernie,

I don't want to change the system sounds. Rather, I want to use the current
system sound that is most appropriate to the situation. How do I find out
what wav file Windows is currently using for "program error", so I can play
that sound, instead of some arbitrarily chosen sound?

It's the same sound that message_box() -- drilling a little deeper,
MessageBoxA() in user32.dll -- plays (whether I want it to or not, which
generally I don't 8^( ). On my computer and instance of Windows 98, since
I'm using the Falling Leaves desktop theme, that sound happens to be a bird
twitter. But I don't want to try to play "birdtwitter.wav" (not the actual
name, I'm not bothering to look it up just now) on EVERYONE's computer, when
my program experiences an error, esp. considering that they may not even
HAVE the Falling Leaves theme on their machine! See my problem?

George

>From: Bernie <xotron at PCOM.NET>

>... your program should
      use it's own wave files and not be concerned about what sounds
      are associated with what instance. Remember that a user maybe
      running a word processor or some other program at the same time
      as your application is running. Changing the system sounds changes
      the sounds for all runing programs and may mess up the other
      programs that are running. There are files in the archive for
      playing wave files.

_____________________________________________________________________________________
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com

new topic     » topic index » view message » categorize

2. Re: 'birdtwitter.wav'

George:
   I think that you will have to do some research on the mci device
   controls. Another thing that you may need to do is to search
   the registry to find what device is being used to produced the
   sound and what sounds are associated with that device. I think
   that the control panel keeps this information in the registry.
   In old win3.1 that info was kept in the ini files. You are taking on
   a major task and I am sorry that I don't have the time to help
   because I am working on a major library for Linux graphics.
   Maybe one of the other list members can help you.
   Good Luck
Bernie

new topic     » goto parent     » topic index » view message » categorize

3. Re: 'birdtwitter.wav'

George -

Sorry to be so slow with this information, but maybe it will be of some help
anyway. As
Bernie's msg(s) indicated you probably don't want to "go this way" for several
reasons.
To my mind, the most important is that there's really no such thing in Windows
as a fixed
set of "system sounds;" the user is free to set and use whatever sounds he
chooses, and
the actual .wav sound files can be located anywhere on the system. IOW, the
"sound
system" for system events is modular. The definition of an "appropriate" sound -
including none at all - is up to the user, and is set  using the Control Panel.
The
"sounds" distributed with Windows as defaults are really just "free samples",
and there's
no guarantee that they exist at all on any given system, much less have any
guaranteed
location.  Many users, such as myself, not only turn off the sound output, but
disassociate the sound files from the "system events" and even delete the .wav
files, or
move them "out of the way." This leaves you basically unable to predict what
sound, if
any,  is even available, much less appropriate. I'm sure M$ will eventually
rectify a
situation in which the user is so blatantly given control over his own hardware;
in the
meantime you're spinning your wheels.

All that having been said, he's some specific information about how to access
existing
sound settings programmatically -

The sound files associated with "system events" are "registered," oddly enough,
in the
Windows Registry, under HKCU - AppEvents - Schemes - Apps. As you can observe,
there are
a number of different sounds registered (or not), both by Windows, and by
individual
programs, e.g. Netscape and AOL,  for their own use. There is actually nothing
specifically identified as "program error" or even "system error." Depending on
your
needs, you would probably choose from AppGPFault, SystemAsterisk,
SystemExclamation,
SystemHand, or System Question. In each case there is probably a setting for
"current"
and "default," but these can both be blank if the user removed the assocations
thru the
Control Panel Sound app.

A further "real world" complexity is this - it's possible, and not *really
rare,* for the
wav files to be deleted or moved *without* disassociating the sounds and without
receiving any error msg until the event linked to the file is triggered, at
which point
the original error which triggered, for example, "SystemExclamation," is
superseded by
the error of "SystemExclamation" not finding the missing wav file .. (No
guarantee any
other program ever raised SystemExclamation since the linked file was deleted.).

In short - it's not worth messing with. If you want predictable sounds, supply
your own
and invoke them within your program, otherwise go with whatever's set.

Ben


George Henry wrote:

> Bernie,
>
> I don't want to change the system sounds. Rather, I want to use the current
> system sound that is most appropriate to the situation. How do I find out
> what wav file Windows is currently using for "program error", so I can play
> that sound, instead of some arbitrarily chosen sound?
>
> It's the same sound that message_box() -- drilling a little deeper,
> MessageBoxA() in user32.dll -- plays (whether I want it to or not, which
> generally I don't 8^( ). On my computer and instance of Windows 98, since
> I'm using the Falling Leaves desktop theme, that sound happens to be a bird
> twitter. But I don't want to try to play "birdtwitter.wav" (not the actual
> name, I'm not bothering to look it up just now) on EVERYONE's computer, when
> my program experiences an error, esp. considering that they may not even
> HAVE the Falling Leaves theme on their machine! See my problem?
>
> George
>
> >From: Bernie <xotron at PCOM.NET>
>
> >... your program should
>       use it's own wave files and not be concerned about what sounds
>       are associated with what instance. Remember that a user maybe
>       running a word processor or some other program at the same time
>       as your application is running. Changing the system sounds changes
>       the sounds for all runing programs and may mess up the other
>       programs that are running. There are files in the archive for
>       playing wave files.
>
>
> _____________________________________________________________________________________
> Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com

new topic     » goto parent     » topic index » view message » categorize

4. Re: 'birdtwitter.wav'

Hi Ben and "list",

I had in mind doing something like: looking up the wav file associated via
Control Panel with SystemExclamation, and if that file exists then playing
it; otherwise, playing the extended disgustingly MIDIfied version of some
already-disgusting death metal/rap song. But if you think just going with my
initial inclination to play a bird twittering is as effective and a lot
easier, maybe I will go with that.

Thanks for your input, to all participants in this discussion.

George


_____________________________________________________________________________________
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com

new topic     » goto parent     » topic index » view message » categorize

5. Re: 'birdtwitter.wav'

> Hi Ben and "list",
>
> I had in mind doing something like: looking up the wav file associated via
> Control Panel with SystemExclamation, and if that file exists then playing
> it; otherwise, playing the extended disgustingly MIDIfied version of some
> already-disgusting death metal/rap song. But if you think just going with
my
> initial inclination to play a bird twittering is as effective and a lot
> easier, maybe I will go with that.
>
> Thanks for your input, to all participants in this discussion.
>
> George
>
You may have gone ahead and done something else by now but this will play
the user's SystemExclamation sound:

--tested code
include dll.e
integer err
constant user32=open_dll("user32.dll"),
MB_ICONEXCLAMATION=#30
err=c_func(xMessageBeep,{MB_ICONEXCLAMATION})

If err returns FALSE then you could go ahead and play your own sound.

chris

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu