Fade In Audio Bug?

Hi,

I am having problems with the Fade In function for audio in the blueprints. If I have the start time set to 0 and have it fade in, say over one second, it works perfectly. However, if I set the start time to a variable that changes (so that I may seek through the audio file) and the fade in time is greater than 0, it completely breaks. The actual fade in time seems to change based on the start time. Sometimes it works fine, but most of the time the fades are quite long, between five and ten seconds. My thoughts are that the actual fade in time is for some reason being changed depending on the length of the audio file and the start time. The audio file I was using is about ten seconds long, and I noticed the longest fade time was about ten seconds. If I faded in halfway through the audio file, it was about five seconds, etc.

Is there a quick fix or easy solution to this, or should I write my own Fade In function?

Thank you,
Brennan

Hi there, yes this was a bug - the fade time was being added to the start time under the assumption that the playback time would start at StartTime but it always begins at zero even if a start time is set. I’ve fixed this in CL#2460065 or you can do it yourself by changing line~180 of AudioComponent.cpp from:

NewActiveSound.TargetAdjustVolumeStopTime = FMath::Max(0.f, StartTime) + FadeInDuration;

to:

NewActiveSound.TargetAdjustVolumeStopTime = FadeInDuration;