-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathWindowsTTS.h
More file actions
35 lines (31 loc) · 993 Bytes
/
WindowsTTS.h
File metadata and controls
35 lines (31 loc) · 993 Bytes
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
// original contributor: Chad Weisshaar
// source code is originated from: https://chadweisshaar.com/blog/2015/07/02/microsoft-speech-for-unity/
// current contributor: Jinki Jung
#ifdef DLL_EXPORTS
#define DLL_API __declspec(dllexport)
#else
#define DLL_API __declspec(dllimport)
#endif
#include <mutex>
#include <list>
#include <thread>
namespace WindowsTTS {
extern "C" {
DLL_API void __cdecl initSpeech();
DLL_API void __cdecl addToSpeechQueue(const char* text);
DLL_API void __cdecl clearSpeechQueue();
DLL_API void __cdecl destroySpeech();
DLL_API void __cdecl changeVoice(int vIdx);
DLL_API bool __cdecl isSpeaking();
DLL_API void __cdecl statusMessage(char* msg, int msgLen);
}
ULONG currentVoiceIndex = 0;
ULONG targetVoiceIndex = 0;
bool speaking = false;
std::mutex theMutex;
std::list<wchar_t*> theSpeechQueue;
std::thread* theSpeechThread = nullptr;
bool shouldTerminate = false;
wchar_t* condition;
std::wstring theStatusMessage;
}