Jump to content

Recommended Posts

Posted (edited)

Hey all,

 

I was thinking about making a program that would generate a steady sound at a inputted frequency. It would play the frequency at a random time between 0 and x seconds, probably something like ten, from pressing "Start". If you'd hear the frequency, you'd press a button. It's purpose would be to test if you can hear that given frequency. Now, I think I'll manage everything, except the GUI, which I can live without of, and the sound generator. Anybody have any tips? I'm gonna use C++.

 

Cheers,

 

Gabe

Edited by Shadow
Posted

Okay, let me rephrase the question; how do you play a sound at a given frequency, for a given duration, but NOT through PC speakers, in C++? I searched the web, couldn't find a thing, so I found myself a tutorial for OpenAl...but I don't even know if OpenAl is capable of that. So, any tips?

  • 4 weeks later...
Posted (edited)

http://msdn.microsoft.com/en-us/library/ms713499(VS.85).aspx

 

http://msdn.microsoft.com/en-us/library/ms713497(VS.85).aspx

 

http://msdn.microsoft.com/en-us/library/ms708482(VS.85).aspx

 

Research if you have questions ask.............

 

kk

 

:P

 

note: search parameters should revolve around tone generator not frequency for your purposes

 

http://www.google.ca/search?hl=en&q=tone+generator+c%2B%2B&btnG=Google+Search&meta=

 

k so the first two in that search are probably all you need to get started I can't find anything aside from these either........... :(

Edited by buttacup
Posted
Okay, let me rephrase the question; how do you play a sound at a given frequency, for a given duration, but NOT through PC speakers, in C++?

 

Where do you plan to output the signal?

Posted

@Buttacup: I was trying to do it without using msdn, I'm not that familiar with the Windows API yet, which was why I was hoping someone would know of a separate library I could download (eg. a Beep() function that would use external speakers instead of the PC speakers). But this will be good enough, I confess I don't recall coming over it in my searches, but then again I did search for frequency and sound, but never for tone...so that may be it. Thanks :)

 

@bascule: I'll have a look, thanks for the tip ;)

 

@Pantaz: External speakers.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.