Showing the changes to interface/src/scripting/TTSScriptingInterface.cpp (1 of 25 files). Show all
Unified · Split
| @@ -66,7 +66,7 @@ void TTSScriptingInterface::updateLastSoundAudioInjector() { · 65 unmodified lines | ||
| 66 | 66 | if (_lastSoundAudioInjector) { |
| 67 | 67 | AudioInjectorOptions options; |
| 68 | 68 | options.position = DependencyManager::get<AvatarManager>()->getMyAvatarPosition(); |
| 69 | − _lastSoundAudioInjector->setOptions(options); | |
| 69 | + DependencyManager::get<AudioInjectorManager>()->setOptions(_lastSoundAudioInjector, options); | |
| 70 | 70 | _lastSoundAudioInjectorUpdateTimer.start(INJECTOR_INTERVAL_MS); |
| 71 | 71 | } |
| 72 | 72 | } |
| @@ -143,7 +143,7 @@ void TTSScriptingInterface::speakText(const QString& textToSpeak) { · 70 unmodified lines | ||
| 143 | 143 | options.position = DependencyManager::get<AvatarManager>()->getMyAvatarPosition(); |
| 144 | 144 | |
| 145 | 145 | if (_lastSoundAudioInjector) { |
| 146 | − _lastSoundAudioInjector->stop(); | |
| 146 | + DependencyManager::get<AudioInjectorManager>()->stop(_lastSoundAudioInjector); | |
| 147 | 147 | _lastSoundAudioInjectorUpdateTimer.stop(); |
| 148 | 148 | } |
| 149 | 149 | |
| @@ -151,7 +151,7 @@ void TTSScriptingInterface::speakText(const QString& textToSpeak) { · 1 unmodified line | ||
| 151 | 151 | uint32_t numSamples = (uint32_t)_lastSoundByteArray.size() / sizeof(AudioData::AudioSample); |
| 152 | 152 | auto samples = reinterpret_cast<AudioData::AudioSample*>(_lastSoundByteArray.data()); |
| 153 | 153 | auto newAudioData = AudioData::make(numSamples, numChannels, samples); |
| 154 | − _lastSoundAudioInjector = AudioInjector::playSoundAndDelete(newAudioData, options); | |
| 154 | + _lastSoundAudioInjector = DependencyManager::get<AudioInjectorManager>()->playSound(newAudioData, options, true); | |
| 155 | 155 | |
| 156 | 156 | _lastSoundAudioInjectorUpdateTimer.start(INJECTOR_INTERVAL_MS); |
| 157 | 157 | #else |
| @@ -161,7 +161,7 @@ void TTSScriptingInterface::speakText(const QString& textToSpeak) { · 3 unmodified lines | ||
| 161 | 161 | |
| 162 | 162 | void TTSScriptingInterface::stopLastSpeech() { |
| 163 | 163 | if (_lastSoundAudioInjector) { |
| 164 | − _lastSoundAudioInjector->stop(); | |
| 165 | − _lastSoundAudioInjector = NULL; | |
| 164 | + DependencyManager::get<AudioInjectorManager>()->stop(_lastSoundAudioInjector); | |
| 165 | + _lastSoundAudioInjector = nullptr; | |
| 166 | 166 | } |
| 167 | 167 | } |