-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
48 lines (25 loc) · 764 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <iostream>
using namespace std;
#include "olcNoiseMaker.h"
//double pi =
double MakeNoise(double dtime)
{
return 0.5 * sin(440.0 * 2 * 3.14159 * dtime);
}
int main()
{
//Get all sound hardware
vector<wstring> devices = olcNoiceMaker<short>::Enumerate();
//Display Devices
for (auto d : devices) wcout << "Found Output Device:" << d << endl;
//Create Sound Machine
//paramaters are: sample rate, number of channels, last two are for latency management
//you can change short to char for 8 bit or int for 32 (short is 16)
olcNoiseMaker<short> sound(devices[0], 44100, 1, 8 ,512);
//connect MakeNoise and NoiseMaker
sound.SetUserFunction(MakeNoise);
return 0;
}
while(1)
{
}