Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
3D sound position

tjbaldy
Registered User
Quote
2012-04-21 21:06:38

I've searched google and these forums without any good specific answer which was strange.

Anyway, I'm trying to add a water sound effect to a fountain I've got in my game but I'm having all sorts of trouble with it.

When I use;

  
irrklang::vec3df position(5000,0,3500);
ISound* waterSound = engine->play3D("media/water.wav", position, true, false);

if(waterSound)
{
waterSound->setMinDistance(30.f);
}


It seems to play everywhere, even if I add a "maxdistance" too.

Without the "mindistance" altogether, the sound doesn't play at all.

So how do I play a sound which has a certain radius around an object?

Much appreciated for anyones help :)


niko
Moderator
Quote
2012-04-22 08:43:21

Hi,

how the min and maxDistance work can be a bit confusing. This page shows how it is working:
http://msdn.microsoft.com/en-us/library/bb147197(VS.85).aspx
altough the image looks like the max distance limits this. The max distance doensn't limit the radius.

If you want more intuitive control over the sound distance, you can use the ESEO_LINEAR_ROLLOFF option so that irrKlang attenuates the volume linearly between min and max distance.


tjbaldy
Registered User
Quote
2012-04-22 22:04:38

wrote:
Hi,

how the min and maxDistance work can be a bit confusing. This page shows how it is working:
http://msdn.microsoft.com/en-us/library/bb147197(VS.85).aspx
altough the image looks like the max distance limits this. The max distance doensn't limit the radius.

If you want more intuitive control over the sound distance, you can use the ESEO_LINEAR_ROLLOFF option so that irrKlang attenuates the volume linearly between min and max distance.


That link was a good read and I understand what I need to do now, thanks.

However, I'm unsure of how to access the DS3D min and max commands. I've looked through the commands from "irrklang::" but that option doesn't appear there :(

Thanks for the help so far!


niko
Moderator
Quote
2012-04-23 19:59:31

The min and max commands in DirectSound directly correlate to the setMinDistance in irrKlang. It's basically the same.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internati?nal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact