History

Fix build errors

Zach Fox committed 8 years ago

Commit 947391e1 parent 22c33212 files · +13 −0Browse files

Showing the changes to interface/src/scripting/TTSScriptingInterface.cpp (1 of 2 files). Show all

Unified · Split

interface/src/scripting/TTSScriptingInterface.cpp+8−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
13#include "avatar/AvatarManager.h"13#include "avatar/AvatarManager.h"
14 14
15TTSScriptingInterface::TTSScriptingInterface() {15TTSScriptingInterface::TTSScriptingInterface() {
16#ifdef WIN32
16 //17 //
17 // Create text to speech engine18 // Create text to speech engine
18 //19 //
@@ -36,11 +37,13 @@ TTSScriptingInterface::TTSScriptingInterface() { · 17 unmodified lines
36 if (FAILED(hr)) {37 if (FAILED(hr)) {
37 qDebug() << "Can't set default voice.";38 qDebug() << "Can't set default voice.";
38 }39 }
40#endif
39}41}
40 42
41TTSScriptingInterface::~TTSScriptingInterface() {43TTSScriptingInterface::~TTSScriptingInterface() {
42}44}
43 45
46#ifdef WIN32
44class ReleaseOnExit {47class ReleaseOnExit {
45public:48public:
46 ReleaseOnExit(IUnknown* p) : m_p(p) {}49 ReleaseOnExit(IUnknown* p) : m_p(p) {}
@@ -53,6 +56,7 @@ public: · 6 unmodified lines
53private:56private:
54 IUnknown* m_p;57 IUnknown* m_p;
55};58};
59#endif
56 60
57void TTSScriptingInterface::testTone(const bool& alsoInject) {61void TTSScriptingInterface::testTone(const bool& alsoInject) {
58 QByteArray byteArray(480000, 0);62 QByteArray byteArray(480000, 0);
@@ -81,6 +85,7 @@ void TTSScriptingInterface::speakText(const QString& textToSpeak, · 22 unmodified lines
81 const int& sampleRate,85 const int& sampleRate,
82 const int& bitsPerSample,86 const int& bitsPerSample,
83 const bool& alsoInject) {87 const bool& alsoInject) {
88#ifdef WIN32
84 WAVEFORMATEX fmt;89 WAVEFORMATEX fmt;
85 fmt.wFormatTag = WAVE_FORMAT_PCM;90 fmt.wFormatTag = WAVE_FORMAT_PCM;
86 fmt.nSamplesPerSec = sampleRate;91 fmt.nSamplesPerSec = sampleRate;
@@ -161,6 +166,9 @@ void TTSScriptingInterface::speakText(const QString& textToSpeak, · 74 unmodified lines
161 166
162 _lastSoundAudioInjector = AudioInjector::playSound(_lastSoundByteArray, options);167 _lastSoundAudioInjector = AudioInjector::playSound(_lastSoundByteArray, options);
163 }168 }
169#else
170 qDebug() << "Text-to-Speech isn't currently supported on non-Windows platforms.";
171#endif
164}172}
165 173
166void TTSScriptingInterface::stopLastSpeech() {174void TTSScriptingInterface::stopLastSpeech() {