Random spatialization or position of sound

Just wondered if there was any method to place audio for a soundscape randomly in the world around the player. For example in source engine it is possible for a sound in the soundscape script to be given a random position property which then occur in a radius around the players current position.

As an example - a soundscape for an outdoor area, you want dogs barking or a bird call in the distance randomly between every x and y seconds and at between x or y volume, however you do not want the sound emitting from the same location every time the sound plays.

Is there any kind of functionality for this in the soundcue editor? Outside of authoring a long sound file with panning included, or placing many ambient sound actors with random delays/modulation. Or is this something I would have to write a blueprint for, that constantly checks the players position and creates a random offset from the player then use playatlocation to place the sound at that random location?

I think this is kind of a situation where it would be best to look at blueprints as it’s kind of outside the possibilities of the SoundCue editor (though having a random location node might be helpful for lots of things). It shouldn’t be too hard to do though, I’ve mocked up the basic flow for a level blueprint:

So there you can see that a delay node is used to wait between 5 and 10 seconds before playing a sound. The sound will then play and link back to the delay node so that a sound will play again in another 5 to 10 seconds (this will vary each time, not just be every 7.7 seconds). I’ve then made a random vector that’s +/-500 units in the x and y coordinates (no z so that sounds don’t come from above or below but that could be included if necessary). Add that to the current position of the camera (or player) and it should result in a sound coming from a random position around you.

While this was made in a level blueprint, it could easily be made as an actor blueprint, with variables for the random ranges and which sound to use. You could then make multiple instances of this blueprint with different sounds/random ranges that could easily be reused in different levels.

Many thanks , this is exactly the kind of thing. Still just trying to find the limits of where blueprints need to come into play vs just the sound cue editor in terms of sound design for UE4 and if it’s kind of “common practice” to use bp editor to extend the sound design potential of the engine, which I see that it is.

Anyway thanks again for the help, very much appreciated.

I wonder why ‘play sound at location’ isn’t available for audio components? With ‘play’ alone, the audio doesn’t get spatialized, regardless of the ‘allow spatialization’ setting.