So here's the dealio, I've created a small menu for terrorists in a jailbreak server to "speak", using a couple of sounds and sound_emit so it's not global but rather coming from the player, which is nice.
here's how it works:
PHP Code:
//menu shows sounds
//choosing from menu plays sound, also creates the speaking spr above the player for 2 seconds
emit_sound(id, CHAN_AUTO, "sound.wav", 0.4, ATTN_NORM, 0, PITCH_NORM)
//a task delays the use of the next sound by the same player by 2 seconds, after which the menu is re-opened automatically(spamming still won't work with binds or whatever, the delay stops sounds from playing)
My questions are:
Should I use one single channel for transmitting sounds? You have to imagine about 10 of these going on at once, and by what I've noticed (but I'm not sure about this) it sometimes interferes with the regular voicecom, and also causes overflows(not even close to sure about this)
What do you think is the best way to make this work? Should I just let it be automatic?
Also, is there any kind of limitations, eg sounds at once per channel, channel specific limitations
PHP Code:
//Sound Channels
#define CHAN_AUTO 0
#define CHAN_WEAPON 1
#define CHAN_VOICE 2
#define CHAN_ITEM 3
#define CHAN_BODY 4
#define CHAN_STREAM 5 //Stream channel from static or dynamic area
#define CHAN_STATIC 6 //Channel from the static area
#define CHAN_NETWORKVOICE_BASE 7 //Voice data coming across the network
#define CHAN_NETWORKVOICE_END 500 //Network voice data reserves slots
//Attenuation values
#define ATTN_NONE 0.00
#define ATTN_NORM 0.80
#define ATTN_IDLE 2.00
#define ATTN_STATIC 1.25
//Pitch values
#define PITCH_NORM 100
#define PITCH_LOW 95
#define PITCH_HIGH 120
//Volume values
#define VOL_NORM 1.0
__________________