Jump to content

EmitSound()- Range And Volume Questions?


Guest Red Ocktober
 Share

Recommended Posts

Guest Red Ocktober

i'm having a lil problem understanding the volume and range of a sound produced with EmitSound()...

 

i did a search for any anomolies, and verified that i was using the function correctly (range is the 3rd argument, volume the fourth)...

 

question... does the sound volume get lower the farther you are away from the sound emitter, or do you have to control the volume manually...

 

question... is playsound() a better alternative...

 

 

thx in advance...

 

 

--Mike

Link to comment
Share on other sites

The volume gets gradually lower until it reaches 0 at the distance which is set with the range parameter.

You must use mono sounds, since stereo sounds are only 0D (they are always hearable, no matter where you are), mono sounds are 3D and 4D.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Indeed, use mono audio files only.

 

EmitSound returns a TSource. You might want to store that to adjust volume and pitch.

 

Here's some code from my CH47 model...

class.soundcompressor = LoadSound("abstract::ch47_compressor_loop.ogg")
...
...
object.source_compressor  = object.model:EmitSound(class.soundcompressor,75,1,1)
SetSourceVolume(object.source_compressor,0.5);

 

That should be all there is to it.

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

Link to comment
Share on other sites

Guest Red Ocktober

thanks for the info guys... checking stuff now...

 

[edit]

that darn squeak sound used in the windmill was stereo...

 

thx again for that really helpfull piece of info about the stereo sound not fading...

 

--Mike

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