Article View: borland.public.cppbuilder.nativeapi
Article #17254Re: PlaySound() API fuction control?
From: Rodolfo Frino - Stargate Softwar...
Date: Tue, 01 Apr 2003 00:17
Date: Tue, 01 Apr 2003 00:17
50 lines
2734 bytes
2734 bytes
You could define a new constant such as SND_NODEFAULT_AND_SILENCE
whose value is not used by any of the existing constants (fdwSound)
and play your sound and then a Silence_1S.wav file which would be a silence
"sound". Then you could loop to get the BEEP-1S Silence- BEEP 1S
Silence -...
bool Play_Sound(LPCSTR FileName, DWORD PlayMode)
{
switch(PlayMode)
{
case SND_APPLICATION:
// The sound is played using an the sound associated with
// the application.
return PlaySound(FileName, NULL, SND_APPLICATION);
case SND_SYNC:
// Return after finishing playing the sound.
return PlaySound(FileName, NULL, SND_SYNC);
case SND_ASYNC:
// Return immediately after beginning playing the sound.
return PlaySound(FileName, NULL, SND_ASYNC);
case SND_LOOP:
// Play sound repeatedly.
return PlaySound(FileName, NULL, SND_LOOP | SND_ASYNC);
case SND_NODEFAULT:
// If the sound cannot be found, PlaySound returns
// without playing the default sound.
return PlaySound(FileName, NULL, SND_NODEFAULT);
case SND_NODEFAULT_AND_SILENCE:
if (!PlaySound(FileName, NULL, SND_NODEFAULT))
return false;
// Play Silence_1S.wav Sound
return Play_Sound("C:\\Directory\\Silence_1S.wav",
SND_NODEFAULT);
default: // Error: Illegal Play Mode
return false;
}
}
Rodolfo
"Jeff Douglass" <.> wrote in message
news:3e8894b1$1@newsgroups.borland.com...
> I have a BCB 5 app that when a condition occures plays a .wav file every
> second to notify the user that the condition has occured.
Technical Details
Message-ID:
<3e88da11@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3e8894b1$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,222458dfba824527 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-03-31 16:18:28 PST From: "Rodolfo Frino - Stargate Software" <starcinema@eftel.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3e8894b1$1@newsgroups.borland.com> Subject: Re: PlaySound() API fuction control? Date: Tue, 1 Apr 2003 10:17:12 +1000 Lines: 52 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 203.129.132.221 Message-ID: <3e88da11@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1049156113 203.129.132.221 (31 Mar 2003 16:15:13 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail