Solved

Beep Question

Posted on 2000-04-07
6
201 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
Comment Utility
Not with beep(), you could try PlaySound() or the various waveXXXX functions to try to do this.

0
 

Author Comment

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

Expert Comment

by:nietod
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:jumanji
Comment Utility
Could you post a code?
0
 
LVL 23

Accepted Solution

by:
chensu earned 100 total points
Comment Utility
#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
Comment Utility
Thnx!  I got it working perfectly!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now