-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.cpp
98 lines (86 loc) · 2.19 KB
/
test.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include <iostream>
#include "Matrix.h"
#include "stdlib.h"
#include "stdio.h"
#include "IO/SphinxEar.h"
#include "IO/FestVox.h"
#include "IO/XComp.h"
#include "Matrix.h"
#include <math.h>
#include "IO/Ear.h"
#include "IO/Terminal.h"
#include <string>
#define SIZE 6
#define VOICES 8
using namespace std;
/*
const char* voices[] = {"(voice_cmu_us_jmk_arctic_clunits)", "(voice_rab_diphone)","(voice_cmu_us_rms_arctic_clunits)","(voice_kal_diphone)",
"(voice_cmu_us_clb_arctic_clunits)","(voice_cmu_us_awb_arctic_clunits)","(voice_ked_diphone)","(voice_cmu_us_slt_arctic_clunits)",
"(voice_cmu_us_bdl_arctic_clunits)","(voice_don_diphone)"};*/
const char* opts[SIZE] = {"God is dead.","Life is meaningless.","All is transe-ent.","Suffering is inevitable.",
"Everyone you know and love will die.", "The pain will never stop."};
FestVox* v;
string word;
void heard(string* s){
printf("heard: %s\n", s->c_str());
word = *s;
}
void testAuditory(){
char s[256];
SphinxEar ear;
v=new FestVox();
ear.startListening(*heard);
word = "hello";
while(gets(s)){
if(s[0]=='.')
break;
v->say(word.c_str());
}
}
void testX(){
XComp x;
x.mouseMove(600, 300);
x.mouseClick();
x.typeSlowly(" hello ", 100000);
x.mouseRelease();
}
void matrix(){
Matrix m(3,3);
Matrix m2(3,3);
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
m.set(i,j,rand()%100);
m2.set(i,j,j+3);
}
}
m.print();
m.invert();
m.print();
m.invert();
m.print();
}
void hearingTest(){
Ear e(1, 16000, SND_PCM_FORMAT_S16_LE);
e.init();
e.startRecording("hello.wav");
sleep(4);
e.stopRecording();
}
void terminalTest(){
Terminal t;
t.println("hello");
t.initAnimScreen(30,10);
for(int i=0;i>-1;i++){
t.setChar(i,i,' ');
t.setChar(i+1, i+1,'*');
usleep(100000);
t.draw();
}
}
int main(){
//terminalTest();
//hearingTest();
//matrix();
testX();
//popen("firefox \"https://www.google.com/search?hl=en&site=imghp&tbm=isch&source=hp&bih=653&q=puppies&oq=puppies\"","r");
}