Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Beep Question

Posted on 2000-04-07
Medium Priority
Last Modified: 2010-04-10
I'm using VC++6 on NT4.  I'm aware of the Beep(freq,dur), but I want to extend the usage of this feature.  I would like to create a chord (possibly 3 notes at once) out of it, but am unable to do so.  Any suggestions?

Sorry, also...  another thing I want to ask is: How do I put a "rest" in the middle of a song?
Question by:jumanji
  • 3
  • 2
LVL 22

Expert Comment

ID: 2695912
Not with beep(), you could try PlaySound() or the various waveXXXX functions to try to do this.


Author Comment

ID: 2696777
What are the variables that I need to put in for PlaySound()?
LVL 22

Expert Comment

ID: 2696828
Its all documented in the VC help.   You need a pointer to a string that specifes the sound (iether a resource ID or a sound file name), the module handle for the module with the sound resource, and soem flags that indicate if the name provided is a resource ID or a file name, plus other options.)
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 2696843
Could you post a code?
LVL 23

Accepted Solution

chensu earned 400 total points
ID: 2696856
#include <mmsystem.h>

::PlaySound(_T("c:\\windows\\media\\chord.wav"), NULL, SND_ASYNC | SND_FILENAME);

Make sure the c:\windows\media\chord.wav file exists. And you need to link with winmm.lib (Menu Project/Settings..., Link tab, Objects/library modules).

Author Comment

ID: 2697005
Thnx!  I got it working perfectly!

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question