Jump to content

Source, Listeners and range


tjheldna
 Share

Recommended Posts

Hi Josh,

 

I think I'll have to make a demo project to show this issue.....

 

I believe there could be an issue with the Source object as this issue occurs if I create a sound in the game world via:

 

 

 

Sound *jumpSound = Sound::Load("Sound/Game/gruntJump.wav");

 

Source *source = Source::Create();

source->SetSound(jumpSound);

jumpSound->Release();

 

source->SetRange(10);

source->SetPosition(entity->GetPosition());

source->Play();

 

OR Using

 

entity->EmitSound()

 

Example 1 (Works) - sound is played at 10m range from entity and listener is 5m from entity

This works - sound plays at correct level compared to distance

 

Example 2 (Works) - sound is played at 10m range from entity and listener is > than 10 m.

This works - sound does not play

 

Now... This is where the issue occurs after following example 2. The sound has played and we didn't hear it as we were outside the range. If I move the listener back within the range of the newly created sound, the sound plays like it was waiting for us to come closer!

 

Hope this makes sense? Let me know if you need more info.

 

Cheers

trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0
Link to comment
Share on other sites

Okay, it's probably an error in the sound manager logic. It doesn't play sounds outside the audible range until you get close enough, but obviously that should only happen for looping sounds.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

This seems to be related -

When using EmitSound() if my listener gets out of range the emitted sound pauses. Then when I come back into range the emitted sound starts playing again from where it paused until it finishes.

It would be better if the emitted sound just kept playing when the listener goes out of range.

  • Upvote 2
Link to comment
Share on other sites

I was doing a bit more testing so basically I'm emitting a sound on the character jump. Recently I've implemented mouse wheel zoom in and out for the camera which really highlighted the issue as the listener is set to the camera's position.

 

The more times I jump the character out of range, the more sounds that are waiting for me when I'm in range.

trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0
Link to comment
Share on other sites

  • 1 month later...
  • 5 months later...
  • 3 years later...
  • 2 weeks later...
  • Admin locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...