LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to play "beep" sound from PC Speaker

Solved!
Go to solution
I used the Beep function in CVI,but the sound card generates the BEEP soud. I want to the PC Speaker generates the BEEP sound. Please help me. Thank you.
Message 1 of 6
(6,622 Views)

If you have a console application, then: printf ("\7"); will do the trick. Unfortunately in a GUI based project this method will also leave a console window visible afterwards...

 

JR

0 Kudos
Message 2 of 6
(6,621 Views)

The Windows SDK defines a function named Beep(), which allows you to play a specified frequency for a specified amount of time on the PC speaker.

 

if it is not already done, you need to install the Windows SDK which is bundled with CVI, and of course, #include <windows.h>.

0 Kudos
Message 3 of 6
(6,613 Views)

yes,I used the Beep(),but no beep sound on PC Speaker. There is beep sound on the sound card.

0 Kudos
Message 4 of 6
(6,578 Views)
Solution
Accepted by topic author ghfirst
The Programmer's Toolbox (toolslib\toolbox\toolbox.fp) provides StartPCSound() and StopPCSound(). They should do.
-----------------------
/* Nothing past this point should fail if the code is working as intended */
Message 5 of 6
(6,572 Views)
Yes,You are right.It is ok. Thank you very much.
0 Kudos
Message 6 of 6
(6,539 Views)