add the beginings of phase interpolation (bloody hell, this is getting

complicated :/, I never guessied it would be this tricy to do phase separated
stereo, but I should have :). Without phase interpolation, you get static
whenever the phase separation changes due to gaps in the mixed samples.
This commit is contained in:
Bill Currie 2000-10-11 04:55:50 +00:00
parent ff972ff50e
commit 7f1c1bb241
3 changed files with 5 additions and 1 deletions

View file

@ -94,7 +94,8 @@
#define ch_dist_mult 44
#define ch_master_vol 48
#define ch_phase 52
#define ch_size 56
#define ch_phase 56
#define ch_size 60
// portable_samplepair_t structure
// !!! if this is changed, it much be changed in sound.h too !!!

View file

@ -90,6 +90,7 @@ typedef struct
vec_t dist_mult; // distance multiplier (attenuation/clipK)
int master_vol; // 0-255 master volume
int phase; // phase shift between l-r in samples
int oldphase; // phase shift between l-r in samples
} channel_t;
typedef struct

View file

@ -515,6 +515,7 @@ void S_StartSound(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float f
target_chan->entnum = entnum;
target_chan->entchannel = entchannel;
SND_Spatialize(target_chan);
target_chan->oldphase = target_chan->phase;
if (!target_chan->leftvol && !target_chan->rightvol)
return; // not audible at all
@ -686,6 +687,7 @@ void S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation)
ss->end = paintedtime + sc->length;
SND_Spatialize (ss);
ss->oldphase = ss->phase;
}