Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Beep Question

Posted on 2000-04-07
6
Medium Priority
?
240 Views
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?
0
Comment
Question by:jumanji
  • 3
  • 2
6 Comments
 
LVL 22

Expert Comment

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

0
 

Author Comment

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

Expert Comment

by:nietod
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.)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

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

 

Author Comment

by:jumanji
ID: 2696843
Could you post a code?
0
 
LVL 23

Accepted Solution

by:
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).
0
 

Author Comment

by:jumanji
ID: 2697005
Thnx!  I got it working perfectly!
0

Featured Post

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!

Question has a verified solution.

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

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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.
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.
Suggested Courses

963 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