Shadow Posted July 14, 2009 Posted July 14, 2009 (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 July 14, 2009 by Shadow
Shadow Posted July 17, 2009 Author Posted July 17, 2009 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?
Xittenn Posted August 8, 2009 Posted August 8, 2009 (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 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 August 8, 2009 by buttacup
bascule Posted August 8, 2009 Posted August 8, 2009 Perhaps ChucK is a better language to do this with than C++: http://chuck.cs.princeton.edu/ 1
Pantaz Posted August 10, 2009 Posted August 10, 2009 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?
Shadow Posted August 10, 2009 Author Posted August 10, 2009 @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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now