Hi pplzzz, how do I use the internal PC speaker to make noises of different frequencies? Like using \a but being able to change the pitch of the noise. I'm using MSVC++. Thanks
Hi pplzzz, how do I use the internal PC speaker to make noises of different frequencies? Like using \a but being able to change the pitch of the noise. I'm using MSVC++. Thanks
Well, input 07 into a char, and when i prints a bell weil sound... That all I have to offer.
I have a rabbit in my pants! Please be happy for me.
How about you do the next best thing...play any wav you want.
include the header file "mmsystem.h" and include the static library "winmm.lib" to your project.
Here's an example of using the function
PlaySound ("C:\\applications\\aim\\sounds\\moo.wav", NULL, NULL);
For simplicity sake, just keep the second and third variables in the parameter NULL. Don't worry about them. Only parameter you want to worry about is the first one, it's the location of the wav file you are going to play.
Last edited by Divx; 10-08-2002 at 12:18 PM.
I don't know how, but it's got to be possible... With BASIC I can tell it to play a frequency and duration, but I can't set the volume. There must be some compilers with a sound.h file(?) Non-ANSA, of course.
I think you have to have a sound card and external speakers to use PlaySound().
You are correct sir!Originally posted by DougDbug
I don't know how, but it's got to be possible... With BASIC I can tell it to play a frequency and duration, but I can't set the volume. There must be some compilers with a sound.h file(?) Non-ANSA, of course.
I think you have to have a sound card and external speakers to use PlaySound().
http://www.programmersheaven.com/zone1/cat88/297.htm
The above may well be just what you're looking for.
Demonographic rhinology is not the only possible outcome, but why take the chance
I noticed that the link you just posted is to a VBX file. How would you incorporate that into a MSVC++ 6.0 app?
Don't bother me with the details, I'm an idea's man
Seriously though, I read the description and assumed that it was correct; "... Is a custom control suitable for use with such programming languages as Visual Basic, Visual C++ and Delphi."
I had figured that the file included libraries & hopefully exapmles suitable for the languages mentioned. Being at work I didn't take the time to download the file & have look.
To be honest I have no idea how to implement a VBX control into Visual C++, though I'd say google would likely provide some help.
Last edited by Azuth; 10-09-2002 at 12:15 AM.
Demonographic rhinology is not the only possible outcome, but why take the chance
http://skirball.med.nyu.edu/~hewz/ht.../ch09/ch09.htm
The above link 'looks' like a good place to start on how you use VBX controls in MSVC++6 (And other ActiveX controls). It does point out that VBX controls can only be used by the 16bit Visual C++ compiler. So I'm not sure about suitability for the original poster.
Demonographic rhinology is not the only possible outcome, but why take the chance