Showing the changes to libraries/script-engine/src/AudioScriptingInterface.cpp (1 of 1 file). Show all
Unified · Split
| @@ -45,8 +45,11 @@ ScriptAudioInjector* AudioScriptingInterface::playSound(Sound* sound, const Audi · 44 unmodified lines | |||
| 45 | // stereo option isn't set from script, this comes from sound metadata or filename | 45 | // stereo option isn't set from script, this comes from sound metadata or filename |
| 46 | AudioInjectorOptions optionsCopy = injectorOptions; | 46 | AudioInjectorOptions optionsCopy = injectorOptions; |
| 47 | optionsCopy.stereo = sound->isStereo(); | 47 | optionsCopy.stereo = sound->isStereo(); |
| 48 | 48 | auto injector = AudioInjector::playSound(sound->getByteArray(), optionsCopy, _localAudioInterface); | |
| 49 | return new ScriptAudioInjector(AudioInjector::playSound(sound->getByteArray(), optionsCopy, _localAudioInterface)); | 49 | if (!injector) { |
| 50 | return NULL; | ||
| 51 | } | ||
| 52 | return new ScriptAudioInjector(injector); | ||
| 50 | 53 | ||
| 51 | } else { | 54 | } else { |
| 52 | qCDebug(scriptengine) << "AudioScriptingInterface::playSound called with null Sound object."; | 55 | qCDebug(scriptengine) << "AudioScriptingInterface::playSound called with null Sound object."; |