Jump to content

Leadwerks Source 3D Sound


martyj
 Share

Recommended Posts

I am having trouble getting 3d sound to work.

 

Setting up a listener at the player position

Player* player = this;
Listener* playerLIstener;
this->playerListener->SetPosition(player ->GetPosition(), true);
this->playerListener->SetRotation(player ->GetRotation(), true);

 

Setting up the playing source

testSound = Sound::Load("Sound/Npc/walking.wav");
source = Source::Create();
source->SetSound(testSound);
source->SetPosition(Vec3(0.0, 2.0, 0.0));
source->SetLoopMode(true);

 

The audio file in question is Mono.

http://i.imgur.com/Xh1EuSO.png

 

Playing of the audio:

if (window->KeyHit(Key:))
{
if (source->GetState() == Source::Playing)
{
 source->Stop();
}
else
{
 source->Play();
}
}

 

The audio is playing in both speakers, but the audio doesn't change volume as the distance grows.

 

Any ideas why the volume isn't changing relative to distance?

Link to comment
Share on other sites

Sounds like the bug report i posted almost a year ago: http://www.leadwerks.com/werkspace/topic/12542-source-setrange-issue/#entry90447

 

Along with an issue with the SetRange(), I also found at the time that you have to position the source after it is played. If you position the source then play it, then it appears to not be positioned and will play the source at full volume.

  • Upvote 1

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

As far as Range goes, is 1.0 one meter? I found that I couldn't hear anything if the range was about 10.0.

 

The SetRange() or source issue seems to be resolved since that bug was posted. What used to happen was the source could be heard when the range was set to less than 1 meter no matter the distance between the source and the listener.

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...