Scripts / Sound Speed

Author
Message
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 29th Aug 2019 12:13
I notice when sound speed is changed it affects all sounds. Is there any way to affect individual sounds?
Julian - increasingly disillusioned and jaded
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 29th Aug 2019 13:02 Edited at: 29th Aug 2019 13:07
sound speed's not even adjusting for me so can't say for sure but if it's anything like the volume you handle it by changing the speed after you play the sound - it's supposed to only change the last sound triggered which works fine for me

in the video i have 1 barrel with the below script and another barrel with a script with no sound volume change at all (doesn't even set the volume)


lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 29th Aug 2019 14:59
The following commands: SetSoundSpeed & SetSoundVolume

Need to be preceded by a call to SetSound( e, v )

So for example to change the volume of sound slot 2 for entity e to 80 you would do:

SetSound( e, 2 )
SetSoundVolume( 80 )

The commands only affects already playing sounds, so you need these to come after the PlaySound( e, 2 ) or LoopSound( e, 2 ) calls.

Hope that helps.
Been there, done that, got all the T-Shirts!
PM
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 29th Aug 2019 19:58
Thank you very much. I think I was doing it in the wrong order.
Julian - increasingly disillusioned and jaded
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th Aug 2019 18:57
Quote: "The following commands: SetSoundSpeed & SetSoundVolume need to be preceded by a call to SetSound( e, v )"

was curious what that command was for, good to know... it doesn't explain why the global sound speed doesn't work for me as that takes the sound ID directly... but as long as lordjulian's is working it's fine though, i don't need it
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 30th Aug 2019 20:15 Edited at: 30th Aug 2019 20:17
SetGlobalSoundSpeed works fine for me, I use it in Bod's vehicle scripts for the engine sound. The sound id for it is not the same as the sound slot in the PlaySound command, instead it is the id specified in the LoadGlobalSound command.

Edited to add: btw the speed value is the bit rate, i.e. 44000 or similar.
Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-05-20 04:25:12
Your offset time is: 2024-05-20 04:25:12