Beep Question

Posted on 2000-04-07
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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.)

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Author Comment

ID: 2696843
Could you post a code?
LVL 23

Accepted Solution

chensu earned 100 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

Technology Partners: 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!

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…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

623 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