UE5: How to get sound effects in sync with moving (timeline) actors?

Hello everyone,

me and my sound designer are wondering what the reason is that >sometimes< the sound effect he produced isn’t in sync with moving actors I created, such as platforms.

My setup is this (roughly broken down):
→ New BP actor → Add static mesh of choice → On Event Begin Play
→ Add Timeline → Define positions for time and location on X/Y/Z axis as needed
→ Hook Update pin into “Set World Location” for the static mesh,
like this in example:

The sound effect for such an actor is an audio component in the BP’s components list.
The wav is set to looping.
The timeline is set to looping.

I would then pass on the timestamps of the timings, how long the timeline is, etc to my sound designer and he would create a sound effect.

Let’s say the timings are: At 0 we are at the start, at 4 we have moved up 200 units (Z) and +500 on the X axis, at second 6 we have the same values because the actor does not move for 2 seconds, at second 10 we are back at starting coordinates.

Let’s say the sound designer would create an effect where the moving actor is producing a buzz sound constantly but at second 4, since we don’t move for 2 seconds, there is an accoustic pause, but after second 6 in the effect track the buzzing continues again.

What we experience instead is that the “pause” in the sound effect is off, meaning that there is buzzing when the actor pauses moving for 2 seconds and suddenly a pause in the sound while the actor is moving.

I even set the wav and the cue to prime on load and also put “prime sound” into the level blueprint. I really don’t know what can be done at this point to ensure sound is in sync.

Can it be something with audio (export) settings that UE5 needs in order to sync audio appropriately?

Anyone please help :slight_smile:
Thank you,
Chris

1 Like

You have to trigger the sounds from the timeline, otherwise it will never sync up.

Not on then ‘update’ pin, but before you go into the timeline.

1 Like

“You have to trigger the sounds from the timeline”

Could you please get me a practical/visual example of that?

1 Like

Just put the play here

1 Like

Ok, then I understood what you were saying so far, but let’s clarify something else for now first:

As mentioned I have the sound as audio compomenent added in the components list and since I am using the same blueprint for multiple different moving actors (give them a number through an editable int variable and switch on int after begin play), I have multiple audio components added in the components list, but all of them “auto activate” false.

And exactly before the timeline I have the component node dragged into the BP executing an “activate” depending what moving platform int it is.

Is “activate” for an audio component different than a “play sound at location”?
I do this by using audio components attached as a child of the static mesh so it’s always at the location of the static mesh all the time.

And yes, before posting here I tried with “just” one platform (as seen in the original screenshot) but still kept the “activate” in there right before the timeline.

I hope this post isn’t too complicated to follow :smiley:

1 Like

It’s a bit of a strange way of doing things :slight_smile:

Most people would just play a wav there. You still get to configure which wav.

1 Like

Yes yes, specifying which wav (or in my case cue) to play isn’t a difficult thing of course :smiley:

So I should not use “activate” on audio components and go with “play sound at location” instead? If yes, how would I ensure that the sound is always with the static mesh, no matter where it is currently at?

“Play sound 2D” and “Play sound at location” don’t have an output pin with which I could promote the sound to a var I could countrol … and probably using tick to constantly move the sound to where the static mesh is probably isn’t a good idea either, right?

1 Like

Spawn sound at location, gives you a pin :wink:

Even if you use a component, you can spawn the sound it plays ( I believe ), and it will move with the object.

1 Like

And then use tick to update the location? Isn’t that performance heavy?

1 Like

No tick.

Spawn sound attached

1 Like

Alrighty, that’s a statement. I’ll try that out tomorrow and get back to you.

So far thank you for being with me :slight_smile:

1 Like

No worries

and

As a matter of fact “spawn sound attached” (put right before the timeline) also goes out of sync. It goes out of sync so hard I can listen to it live shifting away while my previous method kept the out of sync steady :smiley:

However, I did some brainstorming and went through all my existing blueprints in my head to “browse” in which ones I also have moving meshes with looping sounds that rely on “if mesh is there, stop sound, if mesh moves again, continue sound”.

Surprisingly and gladly I did setup such a blueprint in the past where the sound never went out of sync. I don’t even remember exactly why I set up this BP differently but I did, so I carried that style over into the current BP that makes sound sync difficult.

And voilá - here we go, sound now is and stays in sync :slight_smile:

My solution is this: Split timeline in half (so only one-direction-movement), split sound in half (so to say) and code logic for a timeline that is not looping with manual play and play reverse execution orders, like so:

-happy- :slight_smile:

1 Like

Good that you figured it out.

Generally, you just start the sound each time the object moves, that way, you don’t need any other syncing.

1 Like

I think I see what you mean. Because the sounds my sound designer provides me with - I set them to looping, not one-time-play and play them from right before the timeline over and over again.

Thanks for that input, that might come in handy one day or “UE5 moment” perhaps :smiley:

Double :heart: btw because in pretty much all the questions I asked here on the UE forums so far you have always been a highly appreciating help! Hats off! :folded_hands:

1 Like

You’re welcome :slight_smile:

There are more elegant methods, for instance, playing the sound until the object stops moving, and then continue playing from that point, when it starts moving again.

Or, another example, is choose a random point to play the sound from each time the object moves.

It all depends on what sort of sound you have :wink:

1 Like

Now, that it popped into my mind I feel like asking:

Does “Spawn sound attached” spawn a new sound object everytime it is called in front of a timeline?

In terms of after 5 minutes you have 200 spawned sound objects in that one actor.

1 Like

It might, have to check it out :slight_smile:

1 Like

Thanks, would be interesting if it piles up or not.

Unfortunately I don’t know how I could find out with my current knowledge, so I hope you will succeed in that :smiley:

I was under the impression that the component gets destroyed when the sound finishes, but can’t recall…