Jump to content

Listeners and Source Objects


nick.ace
 Share

Recommended Posts

I have two questions regarding sound:

 

1. What are listeners? I can't find any documentation on what they actually are or are supposed to do.

 

2. Has anyone tried the firepit workshop item? It uses a source object in the code, but the farther you get away from it the volume stays the same and sounds the same no matter your position towards it (and there is no stereo effect, like if one ear is closer to the sound than the other, although this might not be implemented). I checked that it's a mono sound, so this behavior seems odd to me since the sound gets positioned at a certain point (so it should be 3D sound). Basically, it sounds like an ambient sound. What are 3D positioned sounds supposed to do?

Link to comment
Share on other sites

It "sounds" like one of the problems I reported about sources here: http://www.leadwerks.com/werkspace/topic/12542-source-setrange-issue/#entry90449 thats been buried under tutorial reports (Josh really should have made a separate category from engine related bugs for that).

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

It "sounds" like one of the problems I reported about sources here: http://www.leadwerks.com/werkspace/topic/12542-source-setrange-issue/#entry90449 thats been buried under tutorial reports (Josh really should have made a separate category from engine related bugs for that).

 

I was reading that bug report, and the ordering I can confirm makes a difference. I started testing stuff out and the ordering matters, but there are other problems I see as well.

 

My test:

  • I opened up tutorial map 7, which is the big industrial map with the crawlers and stuff.
  • I placed the firepit right in front of the big door under the stairs.
  • I started the game, but the sound gets softer the closer you move towards the pit (which shouldn't happen since the listener is parented to the camera, and the source is positioned at the global position of what it is attached to).
  • This also happens in a map I'm working on for a game right now. The volume is inverted.

 

After digging in the code for the FPS template, it seems that the listener gets attached to the camera, not really sure why there ever would be a need for a listener away from the camera (maybe more clarification on this design decision would help).

Link to comment
Share on other sites

You might want to try restarting your pc because something is definitely not right there, I just downloaded the firepit and it appears to work properly - louder the closer you get / silent when more than 5 meters from it using the fpsplayer.

 

 

I really miss the LE2 version of entity:EmitSound() as it would inherently take care of the source position and allow you to use source commands on it. The LE3 version of sources seems to have some issues when it comes to ranges, setting the position before playing, and location/creation of listeners seems to have no effect (sometimes).

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...