AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=7)
-   -   sounds format ? (https://forums.alliedmods.net/showthread.php?t=301417)

abdobiskra 09-20-2017 08:22

sounds format ?
 
Hi
Sometimes when using alternative sounds do not work with the same format ? ex : (wav with othere wav sound )
How can I make sure they must work and be matched like the original sounds in the game ?

fysiks 09-20-2017 09:34

Re: sounds format ?
 
What?

abdobiskra 09-20-2017 10:19

Re: sounds format ?
 
what what ? I think the explanation is clear ..

i just want know the format of the wav sounds in the game because when I replace some sounds do not work with the same format (old sound wav format and new sound its wav to)
so.. I want to know what the problem is and what is the problem going back to make sure that the sounds are correctly converted in the future?

aron9forever 09-20-2017 11:55

Re: sounds format ?
 
in audacity for wave files I do:
- split to mono
- project rate at 16000hz
- save as 16bit
you might also wanna delete any metadata present, you can do this by pressing "clear" on the window with the additional data when saving
most if not all audio software will do wav at 32bit and 44100hz by default which is too much for the old engine

abdobiskra 09-20-2017 13:27

Re: sounds format ?
 
@aron9forever
Can my program be good for that?
In fact, I want to make sure everything

aron9forever 09-20-2017 14:07

Re: sounds format ?
 
I can't understand your question. Most decent audio editing software should be able to do that, if not, just download audacity, it's free and cross-platform. You can edit your sounds in whatever software you want and just convert them later using audacity.

fysiks 09-20-2017 21:09

Re: sounds format ?
 
Quote:

Originally Posted by abdobiskra (Post 2549866)
what what ? I think the explanation is clear ..

Yeah, because you wrote it. That doesn't make it comprehensible. Your new explanation is much much better.

abdobiskra 09-29-2017 06:55

Re: sounds format ?
 
@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 (u8)
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 (u8)
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: :) !

aron9forever 09-29-2017 08:13

Re: sounds format ?
 
That's a problem from your script, not the sound file
I'll be honest here, I don't really know what that forward does or how you would do this on HL but just from intuition I guess, can you please try this out?
Code:
public fw_KeyValue(ent, handle) {     if (pev_valid ( ent ))     {         new g_keyNm[16], g_keyVl[ 32 ], g_ClassNm[16];                 get_kvd ( handle, KV_ClassName, g_ClassNm, charsmax(g_ClassNm));         get_kvd ( handle, KV_KeyName, g_keyNm, charsmax ( g_keyNm ) );         get_kvd ( handle, KV_Value, g_keyVl, charsmax ( g_keyVl ) );                 if (equal(g_ClassNm, "ambient_generic") && equal ( g_keyNm, "message" ) && equal ( g_keyVl, SIREN_OLD_SOUND ))         {             set_kvd(0, KV_Value, SIREN_NEW_SOUND)             dllfunc(DLLFunc_KeyValue, ent, 0)             return FMRES_SUPERCEDE;         }     }     return FMRES_IGNORED;

If that doesn't work then with my limited knowledge I can only suggest you just block the original sound and play the new one "manually" by using a repeating task and emit_sound (check how many times the sound is played and at what interval, then do a 5 second task that runs 8 times for 45 second siren, but remember to play one when you set the task as well)

if that doesn't work or you want the optimal solution please post in the scripting help section, since your sound is played fine one time it means the format is good

abdobiskra 09-29-2017 09:30

Re: sounds format ?
 
@aron9forever
i test my script its work for othere original sound from the game they work well and are replayed again
That's why I doubt the sound and its format or whether there are settings on the map that are hidden idk :p
As for the way I suggested it I was thinking about it and maybe the last solution after I make sure everything is fine


All times are GMT -4. The time now is 10:34.

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