Funcwiki explains it very well.
Example:
Code:
// syntax
// player index, channel, sound, volume, attenuation value, flags, pitch value
emit_sound( index, channel, sample[ ], Float:vol, Float:att, flags, pitch );
// to a player with index "id"
emit_sound( id, CHAN_STATIC, "your sound here", 0.35, ATTN_NORM, 0, PITCH_NORM );
// to everyone
emit_sound( 0, CHAN_STATIC, "your sound here", 0.35, ATTN_NORM, 0, PITCH_NORM );
Code:
/* Constants for emit_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 /* allocate stream channel from the static or dynamic area */
#define CHAN_STATIC 6 /* allocate 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 (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END). */
/* 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 /* non-pitch shifted */
#define PITCH_LOW 95 /* other values are possible - 0-255, where 255 is very high */
#define PITCH_HIGH 120
/* Volume values */
#define VOL_NORM 1.0
__________________