generating a tone in C++

Mookow

Lifer
Apr 24, 2001
10,162
0
0
I remember back in HS I made a program to make whatever tone I wanted to come from my computer speakers. I forget the syntax now. Anyone know?

PS: using Borland 3.1 for Windows as my complier.
 

Mookow

Lifer
Apr 24, 2001
10,162
0
0
I know there is an easier way, and your article didnt make it too clear how to set the frequency at which I want my tone. I dont need to make a sound, as much as I want to make a flat tone...


Bump
 

RSMemphis

Golden Member
Oct 6, 2001
1,521
0
0
Apparently I am an idiot and I don't know of an easier way.
Although I don't think of 4 commands as difficult.
DOS used the sound() command, but I wouldn't use it under Windows.

the first parameter is the voice (which can be left at 1), the second is the note 1..84, which basically conforms with the key layout on a piano, third is the length, where 10 is about a second I think, and the last one is left at 1 as well.

And this produce a note, not a sound.

You, sir, have a tendency to piss people off who try to help you. I won't bother you again.
 

Mookow

Lifer
Apr 24, 2001
10,162
0
0


<< Apparently I am an idiot and I don't know of an easier way.
Although I don't think of 4 commands as difficult.
DOS used the sound() command, but I wouldn't use it under Windows.

the first parameter is the voice (which can be left at 1), the second is the note 1..84, which basically conforms with the key layout on a piano, third is the length, where 10 is about a second I think, and the last one is left at 1 as well.

And this produce a note, not a sound.

You, sir, have a tendency to piss people off who try to help you. I won't bother you again.
>>



Well, someone is pissy today. For the record, I wasnt the one who pissed in your cereal, but thanks for the '1' in my profile. I had said that I wanted to play a tone. The reason I want a tone is to see how my speakers sound at whatever frequency I want (testing my subwoofer, see how loud it plays at 31Hz). Sorry if I pissed you off, I dont think I did anything that should have pissed you off, but sorry nonetheless.
 

RSMemphis

Golden Member
Oct 6, 2001
1,521
0
0
Actually, the 1 in your profile is not from me.
I don't use rankings in profiles at all...

You are right, I overreacted. Let's move on.