Raised This Month: $ Target: $400
 0% 

SVC_SOUND, SVC_STOPSOUND, SVC_FADESOUND


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 10-10-2009 , 10:30   SVC_SOUND, SVC_STOPSOUND, SVC_FADESOUND
Reply With Quote #1

I am interested in these messages if anyone can tell me some details about the arguments that they have
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-10-2009 , 10:34   Re: SVC_SOUND, SVC_STOPSOUND, SVC_FADESOUND
Reply With Quote #2

I've tried to search informations a long time ago, without success. :/
__________________
Arkshine is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 10-10-2009 , 10:39   Re: SVC_SOUND, SVC_STOPSOUND, SVC_FADESOUND
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
I've tried to search informations a long time ago, without success. :/
Not even in HLSDK? (I don't have it right now because I am not at my computer.)
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-10-2009 , 10:40   Re: SVC_SOUND, SVC_STOPSOUND, SVC_FADESOUND
Reply With Quote #4

Actually there is something. Here the source code of svc_sound in the Quake1 source code.

Code:
================== CL_ParseStartSoundPacket ================== */ void CL_ParseStartSoundPacket(void) {     vec3_t  pos;     int     channel, ent;     int     sound_num;     int     volume;     float   attenuation;       int     i;                     channel = MSG_ReadShort();     if (channel & SND_VOLUME)         volume = MSG_ReadByte ();     else         volume = DEFAULT_SOUND_PACKET_VOLUME;         if (channel & SND_ATTENUATION)         attenuation = MSG_ReadByte () / 64.0;     else         attenuation = DEFAULT_SOUND_PACKET_ATTENUATION;         sound_num = MSG_ReadByte ();     for (i=0 ; i<3 ; i++)         pos[i] = MSG_ReadCoord ();       ent = (channel>>3)&1023;     channel &= 7;     if (ent > MAX_EDICTS)         Host_EndGame ("CL_ParseStartSoundPacket: ent = %i", ent);         S_StartSound (ent, channel, cl.sound_precache[sound_num], pos, volume/255.0, attenuation); }

Code:
void S_StartSound(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation) {     channel_t *target_chan, *check;     sfxcache_t  *sc;     int     vol;     int     ch_idx;     int     skip;     if (!sound_started)         return;     if (!sfx)         return;     if (nosound.value)         return;     vol = fvol*255; // pick a channel to play on     target_chan = SND_PickChannel(entnum, entchannel);     if (!target_chan)         return;         // spatialize     memset (target_chan, 0, sizeof(*target_chan));     VectorCopy(origin, target_chan->origin);     target_chan->dist_mult = attenuation / sound_nominal_clip_dist;     target_chan->master_vol = vol;     target_chan->entnum = entnum;     target_chan->entchannel = entchannel;     SND_Spatialize(target_chan);     if (!target_chan->leftvol && !target_chan->rightvol)         return;     // not audible at all // new channel     sc = S_LoadSound (sfx);     if (!sc)     {         target_chan->sfx = NULL;         return;     // couldn't load the sound's data     }     target_chan->sfx = sfx;     target_chan->pos = 0.0;     target_chan->end = paintedtime + sc->length;    // if an identical sound has also been started this frame, offset the pos // a bit to keep it from just making the first one louder     check = &channels[NUM_AMBIENTS];     for (ch_idx=NUM_AMBIENTS ; ch_idx < NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS ; ch_idx++, check++)     {         if (check == target_chan)             continue;         if (check->sfx == sfx && !check->pos)         {             skip = rand () % (int)(0.1*shm->speed);             if (skip >= target_chan->end)                 skip = target_chan->end - 1;             target_chan->pos += skip;             target_chan->end -= skip;             break;         }             } }

Basically it seems to be an emit_sound() like.


svc_stopsound :

Code:
void S_StopSound(int entnum, int entchannel) {     int i;     for (i=0 ; i<MAX_DYNAMIC_CHANNELS ; i++)     {         if (channels[i].entnum == entnum             && channels[i].entchannel == entchannel)         {             channels[i].end = 0;             channels[i].sfx = NULL;             return;         }     } }

I've found nothing about svc_fadesound.
__________________
Arkshine is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 10-10-2009 , 10:44   Re: SVC_SOUND, SVC_STOPSOUND, SVC_FADESOUND
Reply With Quote #5

Thanks a lot!
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-10-2009 , 12:25   Re: SVC_SOUND, SVC_STOPSOUND, SVC_FADESOUND
Reply With Quote #6

Quote:
[OT] Mersy bocu!
I lol'd when i've read that.
__________________
Arkshine is offline
Reply


Thread Tools
Display Modes

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 22:32.


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