File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/framework/audio/engine/internal/export Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -105,10 +105,15 @@ Ret SoundTrackWriter::write()
105105 m_encoderPtr->end ();
106106 }
107107
108- audioEngine ()->setMode (RenderMode::IdleMode);
109-
110- m_source->setOutputSpec (audioEngine ()->outputSpec ());
111- m_source->setIsActive (false );
108+ // ! NOTE Changes to the source and audio engine state
109+ // must be performed via execOperation - so that synchronization with the audio driver process works
110+ IAudioEngine::Operation func = [this ]() {
111+ audioEngine ()->setMode (RenderMode::IdleMode);
112+
113+ m_source->setOutputSpec (audioEngine ()->outputSpec ());
114+ m_source->setIsActive (false );
115+ };
116+ audioEngine ()->execOperation (OperationType::LongOperation, func);
112117
113118 m_isAborted = false ;
114119 };
You can’t perform that action at this time.
0 commit comments