Jump to content

Frequency generator program

Featured Replies

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

  • Author

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...

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

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?

  • Author

@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.

Archived

This topic is now archived and is closed to further replies.

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.