SynthComponent does not execute OnStop() after calling Stop().
OnStop() will be called in PumpPendingMessages() via OnGeneratePCMAudio(). But after stopping the AudioComponent, the procedural SoundWave won't call GeneratePCMAudio() anymore. Therefore, the pending ESynthEvent::OnStop will be executed only after Starting TimeSynth again. As a sideeffect "bIsSynthPlaying" will stay true indefinitely.
User suggested fix: To prevent this, we could use OnEndGenerate() only to set bIsSynthPlaying, and maybe remove OnStop(). Because procedural USoundWave does not have an OnStop() function which will be called before OnEndGenerate().
Synth Example Project has been attached for repro sample.
[Link Removed]
Result:: in some cases when Stop() internally calls AudioComponent->Stop(), OnGenerateAudio won't pump pending messages in Time. In this case you will see:
Start() OnStart() Stop() Start() OnStop() OnStart()
Expected: The following sequence in the Output log:
Start() OnStart() Stop() OnStop()
Note: (Please see attached mp4 for more details)
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-85093 in the post.