Expose bFadingOut to AudioComponent

Hey, I am just trying to do some special behavior when sound is fading out, however I am having trouble detecting it because bFadingOut property of ActiveSound is not accessible via AudioComponent. If I understand right I could get that directly from ActiveSound but I don’t have access to AudioComponentID to find it.

What do you suggest guys ?

Just noticed there is GetAudioComponentID(), however still it would be handy to have access to some advanced properties in blueprints too.

It’s because some of this stuff is relevant to the Audio Thread, not the Game Thread. It’s possible that by the time you use bFadingOut on the Game Thread, it’s actually out of date. You can access this stuff in C++ by running commands on the Audio Thread, but that stuff is outside the scope of Blueprint.

Yes, i know about the limitation. Maybe, for blueprint it would be nice to make some handle functions, with tooltip which warns user about possible out of date state of data. But I understand it is ugly, and leave it up to to developers.

My problem was that my sound was fading out and I suddenly needed to make it fade in again. If I am right I can not use FadeIn function in this case because it plays sound cue from start. I ended up with this:


if (CrashAudioComponent->IsPlaying())
{
	CrashAudioComponent->AdjustVolume(0.1f, 1.f);
}
else
{
	CrashAudioComponent->FadeIn(0.1f);
}

Probably still not perfect because when it is called while sound is fading out (current volume = 0.8 and lowering, IsPlaying() returns true), it starts adjusting volume back to 1.0 but duration of this adjusting is always 0.1f of second. But hmmm, as I am thinking now… It could be probably solved with some simple math which will take in account current volume. :smiley: