Thread: sounds format ?
View Single Post
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 09-29-2017 , 06:55   Re: sounds format ?
Reply With Quote #8

@aron9forever
Thank you for the information you have provided
But I have a strange problem!
I tried to change the sound of the bomb to a map crossfire (serin.wav sound HL1 mod)
PHP Code:
#include <amxmodx>
#include <fakemeta>

#define SIREN_OLD_SOUND "ambience/siren.wav"
#define SIREN_NEW_SOUND "abc/alarm.wav"

new g_kvd

public plugin_precache ()
{
    
precache_sound SIREN_NEW_SOUND );
    
    
g_kvd register_forward FM_KeyValue"fw_KeyValue");
}

public 
plugin_init ()
{
    if(
g_kvd)
    {
        
unregister_forward(FM_KeyValueg_kvd)
    }
}

public 
fw_KeyValue(enthandle)
{
    if (
pev_valid ent ))
    {
        new 
g_keyNm[16], g_keyVl32 ], g_ClassNm[16];
        
        
get_kvd handleKV_ClassNameg_ClassNmcharsmax(g_ClassNm));
        
get_kvd handleKV_KeyNameg_keyNmcharsmax g_keyNm ) );
        
get_kvd handleKV_Valueg_keyVlcharsmax g_keyVl ) );
        
        if (
equal(g_ClassNm"ambient_generic") && equal g_keyNm"message" ) && equal g_keyVlSIREN_OLD_SOUND ))
        {
            
set_kvd(0KV_ClassNameg_ClassNm)
            
set_kvd(0KV_KeyNameg_keyNm)
            
set_kvd(0KV_ValueSIREN_NEW_SOUND)
            
set_kvd(0KV_fHandled0)
            
dllfunc(DLLFunc_KeyValueent0)
            
            
set_kvd(handleKV_fHandledget_kvd (0KV_fHandled))
            return 
FMRES_SUPERCEDE;
        }
    }
    return 
FMRES_IGNORED;

the old sound & the new sound have the same format :
the output :
1) siren.wav : (old sound of the map)
Quote:
Type: Audio
Codec: PCM U8 (u
Channels: Mono
Sample rate: 11025 Hz
Bits per sample: 8
2) alarm.wav : (new sound what i want replace)
Quote:
Type: Audio
Codec: PCM U8 (u
Channels: Mono
Sample rate: 11025 Hz
Bits per sample: 8
Every sound has 5 sec time
my problem : (old sound work in duration 45s Before the bomb exploded ) im not sur if 45s or mor . nvm
The old sound works and is replayed again
But the new sound only works (only 5s) and does not replayed again

@fysiks
The first explanation was the translation
The second was from my RIP ENG :stranger: !
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra