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
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.
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.
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:
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.
Well I already tried this approach and it doesn’t seem to work for me. If I set Music Volume to min (0) then quit the game and restart it, then bring the Music volume back up, there is no music.
I’ve tried the 0.001, 0.01 and 0.1 and no difference.
Also set all Wave files and Cue’s to ‘Play When Silent’ but still not working.
Anyone got any other ideas?