|
-
March 22nd, 2004, 10:48 AM
#1
Playing a beep under Win98
Hi,
I want to play a beep sound with a specified frequency and duration under Win 98 and Win2000.
I know, that there is no problem with Win2000, because the function "Beep(freq, duration)" plays such specified sound.
Under Win98 the parameters are ignored. So : is there an easy way to play such a sound ? or do I have to use DirectSound ?
Thank's in advance,
Corkwick
-
March 23rd, 2004, 12:21 PM
#2
"Notify.wav" is a beep sound. It's in the Windows\Media directory.
#include <mmsystem.h>
Include the library file
#pragma comment(lib, _T("winmm.lib"))
Then use PlaySound().
You can use SND_FILENAME | SND_ASYNC | SND_NODEFAULT as flags.
Add SND_LOOP if you want to loop it.
So, the whole thing might look like
PlaySound(_T("C:\\Windows\\Media\\Notify.wav"), NULL, SND_FILENAME | SND_ASYNC | SND_NODEFAULT);
Steve
-
March 23rd, 2004, 12:53 PM
#3
Thank you, Steve,
my problem ist, that I want to dynamically change duration and frequency of the beep,
so loading a .wav file is no option.
Do you have any other solution for me ?
Thanks again,
Corkwick
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|