Description

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().

Steps to Reproduce

Synth Example Project has been attached for repro sample.

SynthExample.zip[Image Removed]

  1. Download the attached Project Sample
  2. Generate Project Solution Files & Launch Project.
  3. Load "Start" Example Map
  4. Press PIE/Start Stimulating
  5. Observe Output Log

 

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)

 

Have Comments or More Details?

There's no existing public thread on this issue, so head over toAnswerHub just mention UE-85093 in the post.

1
Login to Vote

Unresolved
ComponentAudio
Affects Versions4.224.234.244.25
Target Fix4.25
CreatedNov 26, 2019
UpdatedNov 26, 2019