AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [TF2] EmitSoundToClient Volume Above 1.0 (https://forums.alliedmods.net/showthread.php?t=298825)

RumbleFrog 06-23-2017 14:27

[TF2] EmitSoundToClient Volume Above 1.0
 
I'm having a little problem with EmitSound: If I were to set the volume anything above 1.0, it does not play at all, despite it's precached and downloaded


Example:
PHP Code:

EmitSoundToClient(clientSound_PrestigeSOUND_FROM_PLAYERSNDCHAN_AUTOSNDLEVEL_NORMALSND_CHANGEVOL3.0); 


Kinsi 06-23-2017 16:46

Re: [TF2] EmitSoundToClient Volume Above 1.0
 
Thats because doing said thing isnt possible. Try playing with the level parameter

PHP Code:

/**
 * Various predefined sound levels in dB.
 */
enum
{
    
SNDLEVEL_NONE 0,            /**< None */
    
SNDLEVEL_RUSTLE 20,        /**< Rustling leaves */
    
SNDLEVEL_WHISPER 25,        /**< Whispering */
    
SNDLEVEL_LIBRARY 30,        /**< In a library */
    
SNDLEVEL_FRIDGE 45,        /**< Refrigerator */
    
SNDLEVEL_HOME 50,            /**< Average home (3.9 attn) */
    
SNDLEVEL_CONVO 60,        /**< Normal conversation (2.0 attn) */
    
SNDLEVEL_DRYER 60,        /**< Clothes dryer */
    
SNDLEVEL_DISHWASHER 65,    /**< Dishwasher/washing machine (1.5 attn) */
    
SNDLEVEL_CAR 70,            /**< Car or vacuum cleaner (1.0 attn) */
    
SNDLEVEL_NORMAL 75,        /**< Normal sound level */
    
SNDLEVEL_TRAFFIC 75,        /**< Busy traffic (0.8 attn) */
    
SNDLEVEL_MINIBIKE 80,        /**< Mini-bike, alarm clock (0.7 attn) */
    
SNDLEVEL_SCREAMING 90,    /**< Screaming child (0.5 attn) */
    
SNDLEVEL_TRAIN 100,        /**< Subway train, pneumatic drill (0.4 attn) */
    
SNDLEVEL_HELICOPTER 105,    /**< Helicopter */
    
SNDLEVEL_SNOWMOBILE 110,    /**< Snow mobile */
    
SNDLEVEL_AIRCRAFT 120,    /**< Auto horn, aircraft */
    
SNDLEVEL_RAIDSIREN 130,    /**< Air raid siren */
    
SNDLEVEL_GUNFIRE 140,        /**< Gunshot, jet engine (0.27 attn) */
    
SNDLEVEL_ROCKET 180,        /**< Rocket launching (0.2 attn) */
}; 


RumbleFrog 06-23-2017 22:32

Re: [TF2] EmitSoundToClient Volume Above 1.0
 
Quote:

Originally Posted by Kinsi (Post 2531124)
Thats because doing said thing isnt possible. Try playing with the level parameter

PHP Code:

/**
 * Various predefined sound levels in dB.
 */
enum
{
    
SNDLEVEL_NONE 0,            /**< None */
    
SNDLEVEL_RUSTLE 20,        /**< Rustling leaves */
    
SNDLEVEL_WHISPER 25,        /**< Whispering */
    
SNDLEVEL_LIBRARY 30,        /**< In a library */
    
SNDLEVEL_FRIDGE 45,        /**< Refrigerator */
    
SNDLEVEL_HOME 50,            /**< Average home (3.9 attn) */
    
SNDLEVEL_CONVO 60,        /**< Normal conversation (2.0 attn) */
    
SNDLEVEL_DRYER 60,        /**< Clothes dryer */
    
SNDLEVEL_DISHWASHER 65,    /**< Dishwasher/washing machine (1.5 attn) */
    
SNDLEVEL_CAR 70,            /**< Car or vacuum cleaner (1.0 attn) */
    
SNDLEVEL_NORMAL 75,        /**< Normal sound level */
    
SNDLEVEL_TRAFFIC 75,        /**< Busy traffic (0.8 attn) */
    
SNDLEVEL_MINIBIKE 80,        /**< Mini-bike, alarm clock (0.7 attn) */
    
SNDLEVEL_SCREAMING 90,    /**< Screaming child (0.5 attn) */
    
SNDLEVEL_TRAIN 100,        /**< Subway train, pneumatic drill (0.4 attn) */
    
SNDLEVEL_HELICOPTER 105,    /**< Helicopter */
    
SNDLEVEL_SNOWMOBILE 110,    /**< Snow mobile */
    
SNDLEVEL_AIRCRAFT 120,    /**< Auto horn, aircraft */
    
SNDLEVEL_RAIDSIREN 130,    /**< Air raid siren */
    
SNDLEVEL_GUNFIRE 140,        /**< Gunshot, jet engine (0.27 attn) */
    
SNDLEVEL_ROCKET 180,        /**< Rocket launching (0.2 attn) */
}; 


I thought it could range between 1.0 and 10.0? If I go above 10.0, it gives an error. Also, I have tried SNDLEVEL, and anything above SIREN, cannot be heard.

Edit: I thought SNDLEVEL is how far it could be heard, and since its origin is the player, would it change anything?

RumbleFrog 06-24-2017 19:19

Re: [TF2] EmitSoundToClient Volume Above 1.0
 
I ended up calling EmitSoundToClient twice, and it does sound twice as loud. Is there any better solution for this? Say If I want to do 3x the volume

hmmmmm 06-25-2017 00:11

Re: [TF2] EmitSoundToClient Volume Above 1.0
 
Call it 3 times :D

Kinsi 06-25-2017 15:41

Re: [TF2] EmitSoundToClient Volume Above 1.0
 
Your best bet would be extracting the sound and manually upping its volume, and then using your custom version of the sound. Keep clipping in mind. You can normalize it to 0db in Audacity which will make it as loud as possible w/o clipping and then work from that. But thinking about it: Why do you even need something that loud?

RumbleFrog 06-25-2017 18:55

Re: [TF2] EmitSoundToClient Volume Above 1.0
 
Quote:

Originally Posted by Kinsi (Post 2531680)
Your best bet would be extracting the sound and manually upping its volume, and then using your custom version of the sound. Keep clipping in mind. You can normalize it to 0db in Audacity which will make it as loud as possible w/o clipping and then work from that. But thinking about it: Why do you even need something that loud?

It's barely audible to anyone ATM, although it sounds fine when I manually play it back using VLC or audacity.

Kinsi 06-25-2017 20:01

Re: [TF2] EmitSoundToClient Volume Above 1.0
 
Is the sound you're trying to play in the music folder possibly? Because then its played back at the volume the user has set its music volume to.

RumbleFrog 06-27-2017 13:53

Re: [TF2] EmitSoundToClient Volume Above 1.0
 
Quote:

Originally Posted by Kinsi (Post 2531715)
Is the sound you're trying to play in the music folder possibly? Because then its played back at the volume the user has set its music volume to.

It's in its own custom folder.


All times are GMT -4. The time now is 02:44.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.