Audio networking, API consistency and 3d sound improvements

Does the Ended event work online? Search results show that it has existed for a while. Did it ever work? I just started something sound-related before I knew about actual sound-related updates and I don’t know what isn’t real yet.

Wow, these fixes are really helpful, and the min and max distance properties are well implemented and useful.

HOWEVER, and oh boy, I know this will probably not be recieved well, but could we have a position property? When positional = true, a position property in the sound is used, and doesn’t require a part to use 3D sound. Keeping track of and ignoring parts which hold sounds for raycasting is annoying.
This would be useful in a few very common cases:
knocking on a large wall in different places.
Bullets hitting a part and playing the sound exactly where the bullet hit (no bullet part because raycasts)

5 Likes

Wouldn’t it be better just to have a generic object with just a position and a direction for its children? Meaning you could put things like ParticleEmitters and Sounds inside. The object could even be visible in Studio, which would make it easy to move it around freely. It just wouldn’t be physically simulated.

12 Likes

Yeah that would be fine, too.

It doesn’t look like the Ended event works online at all, even though it isn’t new. The main problem I see is that IsPlaying is still true after Ended would have fired, so there’s no way to know if the sound has ended (until this update comes live.)

I’m still in favor of a lightweight method of playing frequent sounds when we don’t care about stuff like TimeLength or Pausing.

SoundService:PlaySound(id, vol, pitch[, pos])

Sound instances are just overkill for bullet hits, power-ups, button presses, etc.

6 Likes

So that one’s a bit complicated.
With FilteringEnabled, server-created sounds replicate as soon as they enter the workspace and continue to be replicated when moved out of the workspace. They are no longer replicated when parent is set to null.

In addition, with FilteringEnabled, the creation of client-created sounds will not replicate. So, you can make a local 3D sound by creating it in the workspace on the client with FilteringEnabled.

1 Like

Ended event should trigger on both server and all clients with a connected event. They may be off by a delay of network latency (x2 between clients).

EDIT: Reading your latest post, they should be working at least. I’ll take a look at it.

So @zeuxcg has mentioned to me that he’s got general solution to the direct-child-of-part problem (seems like particle emitters and other objects have the same problem?)

2 Likes

FYI that’s what Sound.PlayOnRemove was supposed to be. I would have done it a little differently (autoplay and remove on finish :rolling_eyes:).

If you’re doing a large amount of short sounds (network or local only), I’d recommend making some sort of object pooling system. It’ll have much better performance and less network traffic (if networked).

Is IsPlaying still supposed to be true when it’s finished playing? Stop/Pause hasn’t been called on it, it just reached the end, but IsPlaying is still true. Ended does not fire.

In the updated version, at the end of playback, IsPlaying is false, TimePosition is 0 and Ended should fire for client and server event connections (just tested all of this).

It sounds like it doesn’t happen in the current released version.

I use an object pool atm for local sounds. It seems unnecessarily involved compared to calling a method in SoundService.

Are any of these changes live? There has been a change to 3D sounds that make them non-functional with my Logitech G430 headset. Sound only comes out of the left ear, no matter the relative position of the camera, and noises are extremely faint.

They’re not live.
Tested on live roblox and 3d sounds work for me on mac and windows. Have you checked your system settings?

Also, have you tried the dev-forum members build?

This is on prod. 3D sounds work fine with default speakers and with the 1/8th inch jack, but using the surround sound dongle that comes with the G340 headset has stopped working.

We don’t currently support surround sound.

Well, uh, I don’t know what to say, other than there has been a reduction in audio capability. It used to work just fine, and now it doesn’t. Surround or directional – it doesn’t matter to me, but I’d at least like to hear 3D sounds with my headphones. The crossfade settings are stored in the dongle (for brilliant reasons I’m sure), so I’d like to have it plugged in.

Can you try setting your system to stereo?
And can you hear the footsteps fade out when scrolling away? (That’s the easiest indicator of 3d sounds working).

Maybe it was just a phantom problem. I plugged them in again and things are alright.

The issues were: 3D sound volume drastically lower than 2D sound volume. Playing games like Miner’s Haven, where there are 3D and 2D sounds, the 2D sounds came out perfectly fine, but 3D sounds could not be heard. The truth was that 3D sounds were much quieter, and cranking up the volume on the headset allowed me to hear them, but at the cost of deafeningly loud 2D sound volume (I did not test this at a place with 2D sound). The sound only came out of one ear.

After plugging it in again, things are working better, but the balance is off, against 3D sounds, so they are still quiet but not as quiet as before.

1 Like