Scripts / [SOLVED] Sound volume goes lower, i cant see why.

Author
Message
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 7th Oct 2018 14:04 Edited at: 7th Oct 2018 14:08
hi all , i am working on a different project than my W.I.P and i have the script of perelect were you switch on the custom hud which i modified by adding a third sound which plays power on when you select the hud.
but the sound1 and sound2 slots volume gets lower the further you go away from the object with the script on, but the the sound0 slot's volume stays the same.



Have anyone maybe experience something similar with the sound going softer if you move away from your entity which have the script on.

hoping AmenMoses will read this. lol , i know he will tel me straight that i am doing something wrong.

Thanks
Pcs
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11

The author of this post has marked a post as an answer.

Go to answer
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 7th Oct 2018 14:25 Edited at: 7th Oct 2018 14:26
This post has been marked by the post author as the answer.
Pure speculation but are all the sounds Mono WAV files? 3D sound is only really supported for that format. Ogg file or stereo samples will stay the same volume.

Of course if you want the volume to always stay the same you should use the non-3d sound commands.

Or to put it another way, yes mono wav sounds attached to static entities will get quieter the further away you are (not realistically so though) that's intentional.
Been there, done that, got all the T-Shirts!
PM
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 7th Oct 2018 15:19
Thank you AmenMoses. it works perfect.
i have learned a valuable lesson. will from now on make all my audio files Ogg files.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 7th Oct 2018 16:15
Lol, so you are making a bug into a feature? What will you do when the bug gets fixed?
Been there, done that, got all the T-Shirts!
PM
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 7th Oct 2018 17:13
honestly , i don't know,
will wait until that happens one day. lol. hehehe
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
Avenging Eagle
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 7th Oct 2018 17:37 Edited at: 7th Oct 2018 17:41
Personally I would have used the LoadGlobalSound ("path to sound",number) and PlayGlobalSound (number), because then it will do stereo or mono, regardless.

If you want to control the 'fall-off' of a sound being emitted by an entity, you could use this script, which uses the entity's health to define how far away you can hear the sound:



It should also be noted the volume doesn't seem to work as you'd think it would work in Game Guru. It's not 0 - 100%, it seemed to go silent at around the 30% mark, leading me to believe it's somehow linked with decibels? Either way, make sure you never go over 100% sound volume with a script or it will crash your game.

AE
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 7th Oct 2018 18:46
@Avenging Eagle , Thank you for the information, will use it wisely.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11

Login to post a reply

Server time is: 2024-12-22 21:04:06
Your offset time is: 2024-12-22 21:04:06