Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sound from within MFC programs

Posted on 1999-06-24
5
Medium Priority
?
158 Views
Last Modified: 2013-11-20
I've looked at Directsound and it doesn't seem to be as straightforward as I need. All I need my program to do is generate the occasional beep from the soundcard, independent of driver. Is there anywhere an activex or ocx or some simple to use component I could use to generate a beep of a specified length with one single call?

0
Comment
Question by:rudebarb
[X]
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
5 Comments
 
LVL 4

Expert Comment

by:nil_dib
ID: 1307840
>> All I need my program to do is generate the occasional beep
Why don't you use ::MessageBeep() ??
0
 

Author Comment

by:rudebarb
ID: 1307841
>> All I need my program to do is generate the occasional >> beep

nil_dib> Why don't you use ::MessageBeep() ??
 
Because on a lot of notebook sound systems this just
sounds off the Windows chime.wav instead of a beep.

0
 
LVL 4

Expert Comment

by:nil_dib
ID: 1307842
0
 
LVL 23

Accepted Solution

by:
chensu earned 200 total points
ID: 1307843
On Windows NT, you can use the Beep function. But the Beep function ignores the dwFreq and dwDuration parameters on Windows 9x, in which case, you can write your own Beep function using low-level audio functions or DirectSound. If you want a straightforward method, I suggest you use the PlaySound function. Pre-record or download some wave files and play them using the PlaySound function. For example,

::PlaySound("beep1.wav", NULL, SND_ASYNC | SND_FILENAME);
0
 

Expert Comment

by:rajasaravanan
ID: 1307844
If you just want to produce a beep sound you can just use the function sndPlaySound() Which is a synchronous option for playing small sounds. This is found in mmsystem.h and you must ofcourse include the library winmm.lib into your project settings
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

715 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