[Solved]Spk/Speak Volume-Undesired Outcome Ingame
Hi there guys,
I have a weather plugin, not of my own code, but am trying to edit a part of it. But that is not what this post is about. It is just background info. I know very little about scripting pawn, but enough to be able to customize plugins to my wants. Anyways, a function within that weather plugin calls to emit an ambience rain sound on all clients [rain.wav] in condition zero when entity rain is in effect. However in game, it plays too loud and players dislike it. So I did my research and found bits an pieces on how to control the spk command volume as follows : 1. client_cmd(0, "spk ambience/rain(v40)"); 2. client_cmd(0, "spk ambience/rain.wav",40); I went ahead to make a simple test plugin to see the results in action : PHP Code:
Does anyone know whats going on and how this can be fixed? |
Re: Spk param volume unable emit static specified vol
If you want to fix volume, use emit_sound.
PHP Code:
Float:vol - volume. |
Re: Spk param volume unable emit static specified vol
I see.. I did learn of that command, but what I understood of it was that it emits sound from a specific area/origin and spreads to a defined area units or whole area... unless I'm wrong?
I feel executing the spk command on all clients is the right way to handle rain ambience sound that comes with rain entity created; am I right to assume so? If so, how can I have the volume stay at a fixed rate without it starting out at normal volume and or raising back to normal 100% volume? If not, how would i go about setting up emit_sound... PHP Code:
I would appreciate that. Thank you. |
Re: Volume for spk does not take effect ingame.
if you want to play the sound for everybody set index to 0
if you want to config emit_sound how you want it click Here |
Re: Volume for spk does not take effect ingame.
Fine enough.. but as a final to this call of help. I would like to know why [spk] command doesn't apply the volume parameter, if anyone knows? and why emit_sound is better in the situation of emitting rain ambience sound is better than spk?
Please I would appreciate it. |
Re: Volume for spk does not take effect ingame.
Quote:
Quote:
|
Re: Volume for spk does not take effect ingame.
That is correct, the user notes stated that for emit_sound on one the wiki page for that command that the index was for player values of between 1-32, unless if I am mistaken?
And thank you very much for the details of information you provided on both commands @Backstab. I thank you for that. The ambience sound file [rain.wav] appears to be part of the game files that come with the game. Because as of yet it hasn't ever forced anyone to download it either through server or http. So I am good on that note. It is interesting to know that spk command uses the clients value for sound volume. Which brings me to a specific but perhaps off topic question. Why is it condition zero, that the volume bar for the game sounds (likely wav files) does not function properly? For example, the difference in 1% to full length 100% scroll, is indistinguishable. And when the bar is lower < 1.0 it takes effect on the volume level. And even then, in-game the volume specified does not take effect until I have shot or hit something with knife, and even then the volume returns to client specified volume rather than command specified volume. Perhaps @backstab you may know something on this, or is it a cz bug? Thank you. |
Re: Volume for spk does not take effect ingame.
Quote:
Code:
Nice one buddy |
Re: Volume for spk does not take effect ingame.
Thank you for your reply @Metalic.
I wish you had explained more for an easier understanding, but.. from what I can pick up, does it mean? That the index is for players only? In any case, I have been experimenting with the following code, and the sound and volume emits fine which solves my problem, but.. it creates a new issue, the sound is not emitted the way it is with [speak]. For example : With [emit_sound] the ambience sound file emits sounds from different speakers at varying distances. If I face a certain direction, the sound emits from one of my speakers while the other remains silent. The same happens if I face the opposite of that direction. And I am left with only able to hear the rain sound at equal volume from both speakers facing only two opposing directions, while as I turn with mouse the sound switches speakers. What I would like to achieve is, the sound coming equally from both speakers for all clients as the way speak command handles it? PHP Code:
The channels, (BODY/STREAM/STATIC), does not have any effect on the outcome. And if I change the value of ATTN to anything but NONE, the sound is not emitted. |
Re: [Solved]Spk/Speak Volume-Undesired Outcome Ingame
Alright guys... Thank you to each one of you who contributed.
I somehow got it solved by inserting the command in the original weather plugin, and the sound emits fine at the volume specified, and emits correctly through both speakers in disregards to direction of view. The following is the command that was inserted : PHP Code:
PHP Code:
If someone has more to share on the issue, please do so. ^_^ |
| All times are GMT -4. The time now is 20:36. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.