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
1313 #include "avatar/AvatarManager.h"
1414
1515 TTSScriptingInterface::TTSScriptingInterface() {
16+#ifdef WIN32
1617 //
1718 // Create text to speech engine
1819 //
@@ -36,11 +37,13 @@ TTSScriptingInterface::TTSScriptingInterface() { · 17 unmodified lines
3637 if (FAILED(hr)) {
3738 qDebug() << "Can't set default voice.";
3839 }
40+#endif
3941 }
4042
4143 TTSScriptingInterface::~TTSScriptingInterface() {
4244 }
4345
46+#ifdef WIN32
4447 class ReleaseOnExit {
4548 public:
4649 ReleaseOnExit(IUnknown* p) : m_p(p) {}
@@ -53,6 +56,7 @@ public: · 6 unmodified lines
5356 private:
5457 IUnknown* m_p;
5558 };
59+#endif
5660
5761 void TTSScriptingInterface::testTone(const bool& alsoInject) {
5862 QByteArray byteArray(480000, 0);
@@ -81,6 +85,7 @@ void TTSScriptingInterface::speakText(const QString& textToSpeak, · 22 unmodified lines
8185 const int& sampleRate,
8286 const int& bitsPerSample,
8387 const bool& alsoInject) {
88+#ifdef WIN32
8489 WAVEFORMATEX fmt;
8590 fmt.wFormatTag = WAVE_FORMAT_PCM;
8691 fmt.nSamplesPerSec = sampleRate;
@@ -161,6 +166,9 @@ void TTSScriptingInterface::speakText(const QString& textToSpeak, · 74 unmodified lines
161166
162167 _lastSoundAudioInjector = AudioInjector::playSound(_lastSoundByteArray, options);
163168 }
169+#else
170+ qDebug() << "Text-to-Speech isn't currently supported on non-Windows platforms.";
171+#endif
164172 }
165173
166174 void TTSScriptingInterface::stopLastSpeech() {