It is just a function where you are passing in values
frequency is the sound so a frequency of 440 is a A. so if you put in
- Code: Select all
Beep(440,1000);
you would play an A for one second. You can either hard code straight numbers into it like I just did or you can get user input and put that in with any name you want.
- Code: Select all
cin>> sound;
cin>> length;
Beep(sound,length);
make sure it is a int value. also length is in milliseconds so 100 is a tenth and 1000 is a second just like using the Sleep() function.