Announcement

Collapse
No announcement yet.

Expose bFadingOut to AudioComponent

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 ?

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

    Comment


    • #3
      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.

      Comment


      • #4
        Originally posted by TheJamsh View Post
        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:

        Code:
        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.
        Last edited by Skylonxe; 07-17-2017, 03:40 PM.

        Comment

        Working...
        X