-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaudioOutput.h
More file actions
86 lines (83 loc) · 1.81 KB
/
Copy pathaudioOutput.h
File metadata and controls
86 lines (83 loc) · 1.81 KB
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
#include <SFML/Audio.hpp>
#include <chrono>
#include <thread>
class audioOutput { // The class
public: // Access specifier
audioOutput() { // Constructor
}
void setBufferAndPlay() {
sound.setBuffer(buffer);
sound.play();
while (sound.getStatus() == 2) {
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
std::this_thread::sleep_for(std::chrono::milliseconds(200));
}
void sendAudio_1() {
if (!buffer.loadFromFile("tts/1.mp3.wav"))
exit(-1);
setBufferAndPlay();
}
void sendAudio_2() {
if (!buffer.loadFromFile("tts/2.mp3.wav"))
exit(-1);
setBufferAndPlay();
}
void sendAudio_3() {
if (!buffer.loadFromFile("tts/3.mp3.wav"))
exit(-1);
setBufferAndPlay();
}
void sendAudio_4() {
if (!buffer.loadFromFile("tts/4.mp3.wav"))
exit(-1);
setBufferAndPlay();
}
void sendAudio_5() {
if (!buffer.loadFromFile("tts/5.mp3.wav"))
exit(-1);
setBufferAndPlay();
}
void sendAudio_6() {
if (!buffer.loadFromFile("tts/6.mp3.wav"))
exit(-1);
setBufferAndPlay();
}
void sendAudio_7() {
if (!buffer.loadFromFile("tts/7.mp3.wav"))
exit(-1);
setBufferAndPlay();
}
void sendAudio_8() {
if (!buffer.loadFromFile("tts/8.mp3.wav"))
exit(-1);
setBufferAndPlay();
}
void sendAudio_9() {
if (!buffer.loadFromFile("tts/9.mp3.wav"))
exit(-1);
setBufferAndPlay();
}
void sendAudio_plus() {
if (!buffer.loadFromFile("tts/plus.mp3.wav"))
exit(-1);
setBufferAndPlay();
}
void sendAudio_minus() {
if (!buffer.loadFromFile("tts/minus.mp3.wav"))
exit(-1);
setBufferAndPlay();
}
void sendAudio_mal() {
if (!buffer.loadFromFile("tts/mal.mp3.wav"))
exit(-1);
setBufferAndPlay();
}
void sendAudio_geteilt() {
if (!buffer.loadFromFile("tts/geteilt.mp3.wav"))
exit(-1);
setBufferAndPlay();
}
sf::SoundBuffer buffer;
sf::Sound sound;
};