LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Beep/PCSound doesn't work on Windows 2000 machine.

Has anyone had an issue with hearing the Beep output on a Windows 2000
computer? I have an app that we need to signal the operator to
perform an action or notice an error. I am developing on an XP
machine and the Beep/PCSound function works great. When I carry the
app to the 2000 machine, no beep. The machine will produce sound, the
default windows startup and shutdown music is heard.

Anyone have a clue or sugestions?

Thanks
Andy
0 Kudos
Message 1 of 6
(3,550 Views)
Andy,

Te Beep function is a legacy function, most all computers would have the system speaker and would be able to beep; however in this times of sound cards and digital audio; there are a lot of newer computers that do not support the system Beep any more. There are 2 things that you can try:
+Make sure that there is a sound configured for alert. Some computers grab the beep call and generate the current Windows alarm sound.
+Use the Windows SDK Beep(DWORD dwFreq,DWORD dwDuration). This function is defined in winbase.h, however including windows.h should suffice. Make sure that you don't include utility.h on the file you are using the SDK beep function.

I tested this in my XP machine and I was able to execute both functions. If you know that your user wil
l have speakers, you can use the windows SDK PlaySound(...) function to play a wav file.

Please let me know if you have any further questions.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 2 of 6
(3,548 Views)
JuanCarlos wrote in message news:<506500000005000000C6AF0100-1079395200000@exchange.ni.com>...
> Andy,
>
> Te Beep function is a legacy function, most all computers would have
> the system speaker and would be able to beep; however in this times of
> sound cards and digital audio; there are a lot of newer computers that
> do not support the system Beep any more. There are 2 things that you
> can try:
> +Make sure that there is a sound configured for alert. Some computers
> grab the beep call and generate the current Windows alarm sound.
> +Use the Windows SDK Beep(DWORD dwFreq,DWORD dwDuration). This
> function is defined in winbase.h, however including windows.h should
> suffice. Make sure that you don't include utility.h on the file you
> are usin
g the SDK beep function.
>
> I tested this in my XP machine and I was able to execute both
> functions. If you know that your user will have speakers, you can use
> the windows SDK PlaySound(...) function to play a wav file.
>
> Please let me know if you have any further questions.
>
> Regards,
>
> Juan Carlos
> N.I.

Juan,

Thanks for the help. Tried both options, but to no avail. Still
can't produce a beep or sound of any kind. Could it be a compiling
issue using an XP machine for development and target the app to a 2000
machine?

Andy
0 Kudos
Message 3 of 6
(3,548 Views)
Hi andy,

Most likely that machine does not have a system speaker; if the call to the Windows SDK does not work then I don't think the machine supports the system beep.

I would give a try to the PlaySound function. Together with the waveOutOpen and waveOutSetVolume youcan create an application that sets the volume and play a wav file.

I hope this helps.

Juan Carlos
0 Kudos
Message 4 of 6
(3,548 Views)
I would like to play a wav-file with LabWindow/CVI an my WIN2k machine.

I wrote a program, which the LabWindow comiles. But when I try to run it, than I get:

link error:
undefined symbol 'sndPlaySoundA@8' referenced in "versuch.c"

the problems come when I have a program like this (cut down on the follwing):

#include "windows.h"
#include "cvirte.h"
#include "userint.h"
#include "utility.h"
#include "string.h"
#include "mmsystem.h"
#include "winnt.h"
#include "versuch.h" //program is called "versuch.c"

int main (void)
{
sndPlaySound ("c:\\WINNT\\MEDIA\\CHORD.WAV", SND_SYNC);
}

What can I do? Or where is the error exactly?
Thx for answering!
Greber

Message Edited by Greber on 03-16-2005 02:58 AM

0 Kudos
Message 5 of 6
(3,494 Views)
Did you install SDK with CVI?
Did you add ..\CVI\sdk\lib\winmm.lib to your project?
Look at the sample project that ships with CVI: ...\CVI\samples\sdk\audio\sndplay.prj
0 Kudos
Message 6 of 6
(3,485 Views)