Showing the changes to interface/src/scripting/TTSScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -13,6 +13,7 @@ · 12 unmodified lines | ||
| 13 | 13 | #include "avatar/AvatarManager.h" |
| 14 | 14 | |
| 15 | 15 | TTSScriptingInterface::TTSScriptingInterface() { |
| 16 | +#ifdef WIN32 | |
| 16 | 17 | // |
| 17 | 18 | // Create text to speech engine |
| 18 | 19 | // |
| @@ -36,11 +37,13 @@ TTSScriptingInterface::TTSScriptingInterface() { · 17 unmodified lines | ||
| 36 | 37 | if (FAILED(hr)) { |
| 37 | 38 | qDebug() << "Can't set default voice."; |
| 38 | 39 | } |
| 40 | +#endif | |
| 39 | 41 | } |
| 40 | 42 | |
| 41 | 43 | TTSScriptingInterface::~TTSScriptingInterface() { |
| 42 | 44 | } |
| 43 | 45 | |
| 46 | +#ifdef WIN32 | |
| 44 | 47 | class ReleaseOnExit { |
| 45 | 48 | public: |
| 46 | 49 | ReleaseOnExit(IUnknown* p) : m_p(p) {} |
| @@ -53,6 +56,7 @@ public: · 6 unmodified lines | ||
| 53 | 56 | private: |
| 54 | 57 | IUnknown* m_p; |
| 55 | 58 | }; |
| 59 | +#endif | |
| 56 | 60 | |
| 57 | 61 | void TTSScriptingInterface::testTone(const bool& alsoInject) { |
| 58 | 62 | QByteArray byteArray(480000, 0); |
| @@ -81,6 +85,7 @@ void TTSScriptingInterface::speakText(const QString& textToSpeak, · 22 unmodified lines | ||
| 81 | 85 | const int& sampleRate, |
| 82 | 86 | const int& bitsPerSample, |
| 83 | 87 | const bool& alsoInject) { |
| 88 | +#ifdef WIN32 | |
| 84 | 89 | WAVEFORMATEX fmt; |
| 85 | 90 | fmt.wFormatTag = WAVE_FORMAT_PCM; |
| 86 | 91 | fmt.nSamplesPerSec = sampleRate; |
| @@ -161,6 +166,9 @@ void TTSScriptingInterface::speakText(const QString& textToSpeak, · 74 unmodified lines | ||
| 161 | 166 | |
| 162 | 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 | |
| 166 | 174 | void TTSScriptingInterface::stopLastSpeech() { |