Raised This Month: $51 Target: $400
 12% 

Solved Glitched Audio


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-17-2018 , 08:37   Glitched Audio
Reply With Quote #1

I'm emitting sounds to players but they're either not being emitted or glitch the audio.

I have 4 sounds:

#1, doesn't emit.
PHP Code:
public @HamSpawn_Postid )
{
    if( 
is_user_aliveid ) )
    {
        
client_cmdid"spk %s"g_iSoundsLanding_Sound ] );
    }
    return 
HAM_IGNORED;

#2, Glitches the audio, makes a weird un-pleasant noise.
PHP Code:
public @HamThinkInfoTarget_PreiEnt )
{
    if( ! 
pev_validiEnt ) )
    return 
HAM_IGNORED;
    
    new 
szClassName32 ];
    
peviEntpev_classnameszClassNamecharsmaxszClassName ) );

    if( 
equalszClassNameAIRDROP_CLASSNAME ) )
    {
        
set_peviEntpev_nextthinkget_gametime( ) + 0.01 );
        
        if( 
peviEntpev_flags ) & FL_ONGROUND )
        {
            
client_cmd0"spk %s"g_iSoundsAirDrop_Land_Sound ] );
        }
    }
    return 
HAM_IGNORED;

#3, doesn't emit
PHP Code:
public @HamThinkPlayer_Preid )
{
    if( ! 
is_user_aliveid ) )
    return 
HAM_IGNORED;
    
    if( 
g_bIsPlayerInParachuteid ] )
    {
        static 
Float:fVelocity]; 
        
pevidpev_velocityfVelocity ); 
        
        if( 
pevidpev_flags ) & FL_ONGROUND )
        {
            
g_bIsPlayerInParachuteid ] = false;    
            
client_cmdid"spk %s"g_iSoundsLanding_Sound ] );
        }
    }
    return 
HAM_IGNORED;

#4, Works properly
PHP Code:
MakeAirDropEnt( )
{
    
client_cmd0"spk %s"g_iSoundsAirDrop_Appear_Sound ] );

They're all 8 bit 22050 hz mono channel
__________________

Last edited by edon1337; 07-17-2018 at 17:04.
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-17-2018 , 08:44   Re: Glitched Audio
Reply With Quote #2

1. Show g_iSounds values.
2. Most likely because you set the entity to think each 0.01 seconds and you are always emitting the sound, without ever letting it play. You need to sync the entity think to the sound duration. For example if sound duration is 1 second then the entity should think each 1.0 seconds to let the sound play.
__________________
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-17-2018 , 08:47   Re: Glitched Audio
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
1. Show g_iSounds values.
2. Most likely because you set the entity to think each 0.01 seconds and you are always emitting the sound, without ever letting it play. You need to sync the entity think to the sound duration. For example if sound duration is 1 second then the entity should think each 1.0 seconds to let the sound play.
1)
PHP Code:
PARACHUTE_DEPLOY_SOUND CS_BattleRoyale_Sounds/Parachute_Deploy.wav
LANDING_SOUND 
CS_BattleRoyale_Sounds/Landing.wav
AIRDROP_APPEAR_SOUND 
CS_BattleRoyale_Sounds/AirDrop_Appear.wav
AIRDROP_LAND_SOUND 
CS_BattleRoyale_Sounds/AirDrop_Landing.wav 
2) Doesn't FL_ONGROUND get called only when entity/player hits the ground? So basically just once? I think it does. My entity doesn't jump around for it to get called more than once.
__________________
edon1337 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-17-2018 , 08:53   Re: Glitched Audio
Reply With Quote #4

1. Make sure the sounds are suitable for the game.
2. Make sure the sounds are preached.
3. Make sure the sounds are in the correct path.
4. Make sure when you play the sound you dont spam playing.
5. Make sure you are using wav type sounds when playing with spk/speak.
6. Make sure your client volume is hearable.
7. Make sure your speakers are working .
8. Make sure the length of the file path doesnt overcome the array size.

Some tips.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-17-2018 at 08:55.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-17-2018 , 08:56   Re: Glitched Audio
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
1. Make sure the sounds are suitable for the game.
2. Make sure the sounds are preached.
3. Make sure the sounds are in the correct path.
4. Make sure when you play the sound you dont spam playing.
5. Make sure you are using wav type sounds when playing with spk/speak.
6. Make sure your client volume is hearable.
7. Make sure your speakers are working .

Some tips.
1) I think they are
Quote:
Originally Posted by edon1337 View Post
They're all 8 bit 22050 hz mono channel
2) Yes, they are, otherwise I'd get errors.
3) Same as 2)
4) Might be
5) Yes I am, look at the sound extensions.
6) It is
7) They are
__________________
edon1337 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-17-2018 , 09:01   Re: Glitched Audio
Reply With Quote #6

#3

@HamThinkPlayer_Pre( id )

Is this forward hooked?

If it is, thats mean the landing sound has file error means its not suitable.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-17-2018 at 09:02.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Visinescu
Senior Member
Join Date: Dec 2015
Location: England now,Home Romania
Old 07-17-2018 , 09:04   Re: Glitched Audio
Reply With Quote #7

Why not use MP3 ?
Visinescu is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-17-2018 , 09:08   Re: Glitched Audio
Reply With Quote #8

Quote:
Originally Posted by Natsheh View Post
#3

@HamThinkPlayer_Pre( id )

Is this forward hooked?

If it is, thats mean the landing sound has file error means its not suitable.
It is hooked, how is it not suitable if I'm using the allowed settings?
__________________
edon1337 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-17-2018 , 09:10   Re: Glitched Audio
Reply With Quote #9

Quote:
Originally Posted by Visinescu View Post
Why not use MP3 ?
Because if I want to use emit_sound, MP3 isn't supported.
__________________
edon1337 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-17-2018 , 09:13   Re: Glitched Audio
Reply With Quote #10

Quote:
Originally Posted by edon1337 View Post
It is hooked, how is it not suitable if I'm using the allowed settings?
Well i am helpless, the only way now is trying to debug and check if it get called or not.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:45.


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