Thursday 2 April 2015

Simple sounds via Beep (frequency_hrz, duration_ms) in C++

Leave a Comment
Code:

// simple sounds via Beep
#include <iostream>
#include <windows.h>   // WinApi header
using namespace std;
int main()
{
Beep(523, 500);  // 523 hertz (C5) for 500 milliseconds
Beep(587, 500);
Beep(659, 500);
Beep(698, 500);
Beep(784, 500);

cin.get(); // wait
return 0;

}
If You Enjoyed This, Take 5 Seconds To Share It

0 Questions: