hi, Joe !
_____
However....
Mute &HAD, 0, 1, 0
MsgBox "Did you hear something ???"
Mute &HAD, 0, 1, 0
The answer is: "maybe".
It depends on the length of the (asynchronous) sound associated with "Default Beep".
As I have said elsewhere in this thread, for testing purposes
I associate the Windows XP Startup.wav sound which goes on for about 4.85 sec.
I found your previous post, where you made a mention regarding "startup.wav sound"
(how to tell when beep sound is done?)
_____
By the way, the code fragment above visibly toggles the speaker mute state, as expected.
yes indeed, I forgot to mention that (I apologizes) :D
_____
(Aside... The code fragment works as written only if the speaker is not muted in the first place.
Is there a way to ascertain the mute state beforehand?)
according to this MS-KB article:
SAMPLE: Volume.exe: Set Volume Control Levels Using Visual Basic
http://support.microsoft.com/default...b;en-us;178456
take a look on this thread:
http://tinyurl.com/acflt
(pay special attention to replies 7 & 11)
_____
But the following does not seem to:
Mute &HAD, 0, 1, 0
sndPlaySound "Default Beep", 0
Mute &HAD, 0, 1, 0
Can anyone explain that to me? Just curious.
One theory: sndPlaySound turns off or toggles mute itself.
I disproved that theory by removing the Mute calls, and starting out with the speaker muted.
The sndPlaySound call was silent.
as Chip told you in your previous post, "sndPlaySound ..., 0" (or 1) is for sync/async play mode:
sync: code execution waits (all the time) untill sound finishes to go on
async: code execution continues, disregarding the time-to-go (untill the sound termination)
hth,
hector.