Announcement

Collapse
No announcement yet.

Audio components dont start playing if the volume is 0

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

    Audio components dont start playing if the volume is 0

    Hi everyone, just wanted to drop a note of something that bothered me for days, and i finally found out why and how to fix it, so im leaving it here in case someone else runs into the same problem.

    I was building a music player/sequencer app in UE4 and i had multiple actors with Audio components that i wanted to have playing in Sync. So i figured i just start them all up in the beginning and let the users just raise the volume so they will always play in sync.
    I had a blueprint create copies of a Player blueprint (containing the audio component) and after creating them i did a ForLoop on the array containing them and use an Activate (with reset) to try and play them all at the same time. As i wanted the software to start silent, i also added a Set Volume Multiplier to 0 right at the start so they would start silent, and the user can change the volume by dragging some objects in VR.

    It took me more than id like to admit to figure out that the samples were only starting to play when i set the volume to >0 . I tried all sorts of thing like taking game time and playing when a time was reached and all sorts of other things without success, until i realized they actually start only after i i raise the volume, even if the Activate with reset was launched way before.
    So the Audio component that was activated and supposed to play, will actually wait for the volume to be more than 0 before starting, kinda weird.

    The solution was just having the initial volume set to something like 0.001, so it would still be unhearable but actually started playing when told to. The forLoop worked as expected at that point and the sounds actually started playing in sync.

    TLDR

    If you try to play an audio component and set the sound multiplier to 0 via Blueprint, the sound will not start playing. Make sure the volume multiplier is any positive value and it will play just fine.( if you need it to start silent, use a value like 0.001, anything but 0)

    I am not sure this is an intended feature or a bug, this behavior it is not explained anywhere and somewhat unintuitive.

    Hope this helps someone not loose two days as i did ^_^

    L.

    #2
    This is old known issue.
    When volume == 0 the "proxy" (audio runs on separate thread) will drop it's "work" until game thread updates volume value. If cue isn't looping the sound just quit altogether until you play it again.
    | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

    Comment


      #3
      oh ok, thank you, just wanted to leave it because i could not find this info in the forum, must be poor search skills : )
      By the way, my cues were looping. but this fact persistet.

      Comment


        #4
        Go into your SoundWave (not SoundCue) and look for "Virtualize when Silent".
        Turn this on.

        Comment


          #5
          I am unable to find this option please help

          Comment


            #6
            Hello,

            Look for Virtualization Mode. It's available in both Waves and Cues.

            Click image for larger version

Name:	play.jpg
Views:	487
Size:	186.9 KB
ID:	1771558

            Comment


              #7
              This no longer seems to work with Unreal 4.24. I've set the Play when Silent on the wav, the sound cue, and the game settings, and even with all three set changing the volume to zero stops the music playing inexplicably. I have verified this bug. I'm having to resort to the old hack of setting the volume to a very small, positive, non-zero value.

              Because of this I now have to do this extra bs for a volume slider:
              Click image for larger version  Name:	Volume Bug.png Views:	0 Size:	38.5 KB ID:	1807883
              The bottom value is an arbitrary one that I hope is quiet enough.
              Last edited by Avelworldcreator; 09-03-2020, 04:48 PM.

              Comment


                #8
                Originally posted by Avelworldcreator View Post
                This no longer seems to work with Unreal 4.24. I've set the Play when Silent on the wav, the sound cue, and the game settings, and even with all three set changing the volume to zero stops the music playing inexplicably. I have verified this bug. I'm having to resort to the old hack of setting the volume to a very small, positive, non-zero value.

                Because of this I now have to do this extra bs for a volume slider:
                Click image for larger version Name:	Volume Bug.png Views:	0 Size:	38.5 KB ID:	1807883
                The bottom value is an arbitrary one that I hope is quiet enough.
                Virtualization working on on v4.25. Is the sound an audio component that has been added to the actor in the my blueprints panel or is it a sound that is being spawned? I had it right once and was doing something else that threw me off. Glad i found this page tho. That was driving me crazy and it was just a little bs funny haha testing project.

                Comment

                Working...
                X