Audio component only plays on one client?

I have an audio component on a character. An animnotify event calls an event on the character which plays the sound. I have verified that the event is being called on the correct objects on all clients and the listen server but the sound will only play on one.

I have tried with fmod and with normal engine audio. I have tried with and without attenuation. I have tried packaged online with others and in editor.

Another odd thing is that if a character dies and another character calls that animnotify then the sounds will only work for that player. All sounds from all players will work but only for that player.

The debugger will show that the fire sound event is being called on each and every client and the listen server but it just doesn’t replicate properly.

Hey Burnrate,

I’ve attempted to reproduce the issue in a clean project, but I’m not seeing the same results, which leads me to believe I might be overlooking something. Would you mind giving this a shot yourself and seeing if you can narrow down the issue? If so, could you please provide a detailed list of steps we can use to reproduce the issue on our end?

Thanks

Hi Sean, thank you for replying.

What I did here was create a simple BP Third person project with 4.15. In the run anim I added two custom anim notifies for the right and left foot impacts. Those anim notifies called the play footstep event in the character.

When testing I added a pktlag of 1000 ms to each client and listen server. Then when one would run by the other you could hear your own sounds, but after the delay the character would run by the other one on the other window and no sounds would be heard. The event is clearly firing based on the anim notify but no sound.

Here is a video.

Some random things I have tried:

  • tried setting a sound variable that is repnotify and then setting the sound in the audio component using that notify function
  • replicating the component

This also happens in 4.14 and in packaged projects tested over the internet.

Here is the zipped test project:
https://drive.google.com/open?id=0BzEL4hqy9vKaMm9DdF9fNEZpS2s

I would like to know more as well. I noticed this as well when trying to reproduce on a client hosted game.

Sorry for the delay. Oddly enough, when I tested the project you’ve provided in 4.15.1 it seemed to be working as intended. Even after adding the pktlag of 1000ms, I was still able to hear the sounds on both the server and client after multiple attempts.

Would you mind giving this a shot in 4.15.1 to see if you still see the same issue?

Thanks for providing a test project, by the way.

Hi Sean, Still getting the same behavior in 4.15.1.

Any success with 4.14? Or with the demo I sent using 4.15.0? How did the testing go with those version?

I posted the product version for 4.14 because we don’t want to upgrade again before release.

Any idea on why it might work in 4.15.1 and not earlier? What code was changed possible? We could make a custom engine version to fix the problem if it is identified.

Any ideas on how I might be able to get it to work in 4.15.1 as well? Can you send me a detailed list of actions you took in order to make it work?

I wasn’t able to reproduce the issue on my end, so I wasn’t able to test 4.14.

Unfortunately, there isn’t a ticket in our database that I could find that details a fix. But it’s possible that my steps inside of your project were incorrect so that’s why I didn’t see the issue.

With 4.15.0 and 4.15.1, I didn’t see the issue occurring based on the steps you’ve provided. How many clients are you typically playing with when you see the issue occur? Does it occur with just a server and a client, or only if you are using multiple connected clients?

Hi Sean

It is specifically between the listen server and any number of clients or the other way around, client actions don’t cause the listen server to make the sounds. Clients seem to work with each other ok. The number of clients doesn’t matter.

So you are saying that both 4.15.0 and 4.15.1 work for you now? Why no testing on 4.14? Can you give me a list of the steps you took in order to make this work properly (that went beyond opening the project I sent)?

It’s very weird because you can watch the event fire but nothing happens.

As stated, I was unable to test on 4.14 because the project you provided was created in 4.15, at least as far as I understand, and there’s no way to roll back. When I tested in 4.14 I was unable to reproduce the issue by playing a sound based on an event such as key press.

As far as the steps I took, I booted up the project, played in a new window with 2 players, set net pktlag to 1000, and then ran to trigger the sound. Then, after I ran, I quickly switched over to the Server or Client (depending on which did the running) and I was able to hear the sounds play as the characters moved.

I didn’t change any settings or anything inside of the project you provided, just to be clear.

Is there a step that I’m missing somewhere in your project?

Hi Sean

I feel like with all the different engine versions and testing I got a little off topic.

Best way I can summarize the problem is when playing, everyone hears the audio like they are at the viewpoint of one specific person.

So you can hear yourself only near them but you always hear their sounds.

The person everyone is hearing as can change on deaths and respawn.

I guess this is a little different than what I originally described but it is hard to narrow it down.

Does this sound like anything familiar to you?

Alright, so after further testing I think I’ve figured out the issue.

When you’re expecting to hear the sound, it doesn’t look like you have the other window focused. For me, when I focus the client, I can only hear the audio that is played on the client itself. In order to hear the server’s audio, you’ll need to focus the server window. So it seems to me that the issue is that you’re not able to hear the audio playing because you need to ensure that the window that you are expecting to hear audio from has focus. Does that make sense?

Try this: play on two separate machines and add some extra lag, maybe 10000ms. Doing this, I was able to hear the audio on both the server and client machines without issue.

Let me know if you have further questions regarding this, or if you think I’m overlooking something.

Have a great day

Hi Sean. Unfortunately that’s not it at all. This occurs in packaged builds played across the internet as well.

What happens is every player hears the sound coming from the viewpoint of one player. That one player can change on death and respawn. It’s like the try get owning pawn of the anim BP gets the same character on every client.

Gotcha, that’s just what it looked like to me based on the video because I never noticed the server window regaining focus.

I just haven’t been able to see that same behavior unfortunately on my end. When I tested, the footstep audio was coming from the player that was moving, and the audio would fade or increase in volume depending on that character’s distance to the player. Are you seeing this consistently or is it only something that happens every few tries?

It is consistent. We have tried altering a lot of small things but the behavior is the same each time.

Sadly, I’m not able to reproduce the issue you are experiencing. Each time I’ve tested, the sound seems to be coming from the correct player, regardless of whether it is the server or the client that is causing the sound to play.

Without a way to reproduce the issue, we are currently unable to take any further action on this issue.

If you come across any new information or ideas as far as why we may not be seeing this on our end, feel free to leave a comment to reopen the thread, and I’ll be glad to continue to investigate.

Have a great day

Can I pm you a link to a zip of our project. I know there is a lot more going on but perhaps taking a look there will show you something that is missing from the example project?

Sure, I’ll take a look at it and see if I can spot anything that may be causing the issue.

You can pm me the link on the forums: https://forums.unrealengine.com/authorize.php?code=27989ab259ab42c78c4e228a279bdd29&state=https%3A%2F%2Fforums.unrealengine.com%2Fmember.php%3F160394-Sean-Flint

The active PIE window is not an issue. I’ve tested it even using the SoloAudio command with other audio that works correctly.

I believe the question needs to be readdressed to the SetAudioListenerOverride function. This was active in the project and in order to hear the sounds from the mesh instead of the camera, this works great in a single player instance. When having multiple players, the last client to join is the only one to be the receiver of sounds that other active windows pick up.

Even assigning the SetAudioListenerOverride function in the ControllerBP, then assigning the target by casting to the character’s mesh does the same effect. The last client who joins in is the only listener.

It’s like the last player steals everyone else’s ears and runs around with them.

Thanks for the additional information. Was this the case in the test project you’ve provided as well?

I understand what the issue that you are reporting is, but when I’ve run the provided project I’m hearing the audio playing as expected from both the client and the server.