OpenAL WIP.

This commit is contained in:
Steven Fuller 2008-05-20 01:00:47 -07:00 committed by Patryk Obara
parent 68a0572d13
commit c6dec0e4d9

View file

@ -24,9 +24,9 @@ ACTIVESOUNDSAMPLE BlankActiveSound = {SID_NOSOUND,ASP_Minimum,0,0,NULL,0,0,0,0,0
SOUNDSAMPLEDATA BlankGameSound = {0,0,0,0,0,NULL,0,0,NULL,0}; SOUNDSAMPLEDATA BlankGameSound = {0,0,0,0,0,NULL,0,0,NULL,0};
SOUNDSAMPLEDATA GameSounds[SID_MAXIMUM]; SOUNDSAMPLEDATA GameSounds[SID_MAXIMUM];
ALCdevice *AvpSoundDevice; static ALCdevice *AvpSoundDevice;
ALvoid *AvpSoundContext; static ALvoid *AvpSoundContext;
int AvpFrequency = 44100; static int AvpFrequency = 44100;
extern int WantSound; extern int WantSound;
@ -188,6 +188,7 @@ int PlatStartSoundSys()
alcMakeContextCurrent(AvpSoundContext); alcMakeContextCurrent(AvpSoundContext);
alListenerf(AL_GAIN, 1.0);
alListenerfv(AL_POSITION, pos); alListenerfv(AL_POSITION, pos);
alListenerfv(AL_VELOCITY, vel); alListenerfv(AL_VELOCITY, vel);
alListenerfv(AL_ORIENTATION, or); alListenerfv(AL_ORIENTATION, or);
@ -488,27 +489,29 @@ int PlatPlaySound(int activeIndex)
{ {
int si; int si;
if (!SoundActivated) if (!SoundActivated) {
return 0; return 0;
}
if ((activeIndex < 0) || (activeIndex >= SOUND_MAXACTIVE)) if ((activeIndex < 0) || (activeIndex >= SOUND_MAXACTIVE)) {
return 0; return 0;
}
si = ActiveSounds[activeIndex].soundIndex; si = ActiveSounds[activeIndex].soundIndex;
if ((si < 0) || (si >= SID_MAXIMUM)) if ((si < 0) || (si >= SID_MAXIMUM)) {
return 0; return 0;
if (!GameSounds[si].loaded) }
if (!GameSounds[si].loaded) {
return 0; return 0;
}
if (!PlatSoundHasStopped(activeIndex)) alSourceStop(ActiveSounds[activeIndex].ds3DBufferP);
PlatStopSound (activeIndex);
alSourcei (ActiveSounds[activeIndex].ds3DBufferP, AL_BUFFER, alSourcei(ActiveSounds[activeIndex].ds3DBufferP, AL_BUFFER,
GameSounds[si].dsBufferP); GameSounds[si].dsBufferP);
if (ActiveSounds[activeIndex].loop) alSourcei(ActiveSounds[activeIndex].ds3DBufferP, AL_LOOPING,
alSourcei (ActiveSounds[activeIndex].ds3DBufferP, AL_LOOPING, AL_TRUE); ActiveSounds[activeIndex].loop ? AL_TRUE : AL_FALSE);
else
alSourcei (ActiveSounds[activeIndex].ds3DBufferP, AL_LOOPING, AL_FALSE);
if (1 || ActiveSounds[activeIndex].pitch != GameSounds[si].pitch) { if (1 || ActiveSounds[activeIndex].pitch != GameSounds[si].pitch) {
PlatChangeSoundPitch(activeIndex, ActiveSounds[activeIndex].pitch); PlatChangeSoundPitch(activeIndex, ActiveSounds[activeIndex].pitch);
@ -555,15 +558,12 @@ void PlatStopSound(int activeIndex)
#ifdef OPENAL_DEBUG #ifdef OPENAL_DEBUG
fprintf(stderr, "OPENAL: PlatStopSound(%d)\n", activeIndex); fprintf(stderr, "OPENAL: PlatStopSound(%d)\n", activeIndex);
#endif #endif
if (!SoundActivated) if (!SoundActivated) {
return; return;
}
// if (ActiveSounds[activeIndex].paused) // TODO: should be able to release data here
// alSourcePause (ActiveSounds[activeIndex].ds3DBufferP); alSourceStop(ActiveSounds[activeIndex].ds3DBufferP);
// else
// alSourceStop (ActiveSounds[activeIndex].ds3DBufferP);
if (!PlatSoundHasStopped (activeIndex))
alSourceStop (ActiveSounds[activeIndex].ds3DBufferP);
} }
/* table generated by: /* table generated by:
@ -590,8 +590,9 @@ static const float vol_to_gain_table[] = {
int PlatChangeGlobalVolume(int volume) int PlatChangeGlobalVolume(int volume)
{ {
if (!SoundActivated) if (!SoundActivated) {
return 0; return 0;
}
alListenerf(AL_GAIN, vol_to_gain_table[volume]); alListenerf(AL_GAIN, vol_to_gain_table[volume]);
@ -600,8 +601,9 @@ int PlatChangeGlobalVolume(int volume)
int PlatChangeSoundVolume(int activeIndex, int volume) int PlatChangeSoundVolume(int activeIndex, int volume)
{ {
if (!SoundActivated) if (!SoundActivated) {
return 0; return 0;
}
alSourcef(ActiveSounds[activeIndex].ds3DBufferP, alSourcef(ActiveSounds[activeIndex].ds3DBufferP,
AL_GAIN, vol_to_gain_table[volume]); AL_GAIN, vol_to_gain_table[volume]);
@ -615,11 +617,13 @@ int PlatChangeSoundPitch(int activeIndex, int pitch)
SOUNDINDEX gsi = ActiveSounds[activeIndex].soundIndex; SOUNDINDEX gsi = ActiveSounds[activeIndex].soundIndex;
if (!SoundActivated) if (!SoundActivated) {
return 0; return 0;
}
if ((pitch < PITCH_MIN) || (pitch >= PITCH_MAX)) if ((pitch < PITCH_MIN) || (pitch >= PITCH_MAX)) {
return 0; return 0;
}
if (pitch == PITCH_DEFAULTPLAT) { if (pitch == PITCH_DEFAULTPLAT) {
frequency = GameSounds[gsi].dsFrequency; frequency = GameSounds[gsi].dsFrequency;
@ -660,17 +664,20 @@ int PlatSoundHasStopped(int activeIndex)
fprintf(stderr, "PlatSoundHasStopped(%d)\n", activeIndex); fprintf(stderr, "PlatSoundHasStopped(%d)\n", activeIndex);
#endif #endif
if (!SoundActivated) if (!SoundActivated) {
return 0; return 0;
}
alGetSourceiv (ActiveSounds[activeIndex].ds3DBufferP, alGetSourceiv (ActiveSounds[activeIndex].ds3DBufferP,
AL_SOURCE_STATE, &val); AL_SOURCE_STATE, &val);
if (alGetError () != AL_NO_ERROR) if (alGetError () != AL_NO_ERROR) {
return SOUND_PLATFORMERROR; return SOUND_PLATFORMERROR;
}
if ((val != AL_PLAYING) && (val != AL_PAUSED)) if ((val != AL_PLAYING) && (val != AL_PAUSED)) {
return 1; return 1;
}
return 0; return 0;
} }
@ -681,11 +688,12 @@ int PlatDo3dSound(int activeIndex)
VECTORCH relativePosn; VECTORCH relativePosn;
int newVolume; int newVolume;
if (!SoundActivated) if (!SoundActivated) {
return 0; return 0;
}
if (ActiveSounds[activeIndex].threedee == 0) // if (ActiveSounds[activeIndex].threedee == 0)
return 1; // return 1;
relativePosn.vx = ActiveSounds[activeIndex].threedeedata.position.vx - relativePosn.vx = ActiveSounds[activeIndex].threedeedata.position.vx -
Global_VDB_Ptr->VDB_World.vx; Global_VDB_Ptr->VDB_World.vx;
@ -696,14 +704,12 @@ int PlatDo3dSound(int activeIndex)
distance = Magnitude(&relativePosn); distance = Magnitude(&relativePosn);
/* Deal with paused looping sounds. */
if (ActiveSounds[activeIndex].paused) { if (ActiveSounds[activeIndex].paused) {
if (distance < (ActiveSounds[activeIndex].threedeedata.outer_range + SOUND_DEACTIVATERANGE)) { if (distance < (ActiveSounds[activeIndex].threedeedata.outer_range + SOUND_DEACTIVATERANGE)) {
PlatStopSound (activeIndex);
if (ActiveSounds[activeIndex].loop) alSourcei(ActiveSounds[activeIndex].ds3DBufferP, AL_LOOPING,
alSourcei (ActiveSounds[activeIndex].ds3DBufferP, AL_LOOPING, AL_TRUE); ActiveSounds[activeIndex].loop ? AL_TRUE : AL_FALSE);
else
alSourcei (ActiveSounds[activeIndex].ds3DBufferP, AL_LOOPING, AL_FALSE);
alSourcePlay (ActiveSounds[activeIndex].ds3DBufferP); alSourcePlay (ActiveSounds[activeIndex].ds3DBufferP);
newVolume = 0; newVolume = 0;
@ -716,31 +722,35 @@ int PlatDo3dSound(int activeIndex)
if (distance < ActiveSounds[activeIndex].threedeedata.inner_range) { if (distance < ActiveSounds[activeIndex].threedeedata.inner_range) {
newVolume = ActiveSounds[activeIndex].volume; newVolume = ActiveSounds[activeIndex].volume;
} else { } else {
/* Use proper 3D, but our own attenuation. */
if (distance < ActiveSounds[activeIndex].threedeedata.outer_range) { if (distance < ActiveSounds[activeIndex].threedeedata.outer_range) {
float in_to_dis_to_out = ActiveSounds[activeIndex].threedeedata.outer_range - distance; float in_to_dis_to_out = ActiveSounds[activeIndex].threedeedata.outer_range - distance;
float in_to_out = ActiveSounds[activeIndex].threedeedata.outer_range - ActiveSounds[activeIndex].threedeedata.inner_range; float in_to_out = ActiveSounds[activeIndex].threedeedata.outer_range - ActiveSounds[activeIndex].threedeedata.inner_range;
if (in_to_out > 0.0) { if (in_to_out > 0.0) {
newVolume = (int) newVolume = (int)((float)ActiveSounds[activeIndex].volume * (in_to_dis_to_out / in_to_out));
((float)ActiveSounds[activeIndex].volume * (in_to_dis_to_out / in_to_out));
} else { } else {
newVolume = 0; newVolume = 0;
} }
} else { } else {
newVolume = 0; newVolume = 0;
/* Deal with looping sounds. */
if ((distance < (ActiveSounds[activeIndex].threedeedata.outer_range + SOUND_DEACTIVATERANGE)) && if ((distance < (ActiveSounds[activeIndex].threedeedata.outer_range + SOUND_DEACTIVATERANGE)) &&
ActiveSounds[activeIndex].loop) { ActiveSounds[activeIndex].loop) {
PlatStopSound (activeIndex);
alSourcePause(ActiveSounds[activeIndex].ds3DBufferP);
ActiveSounds[activeIndex].paused = 1; ActiveSounds[activeIndex].paused = 1;
} }
} }
} }
if (newVolume > VOLUME_MAX) if (newVolume > VOLUME_MAX) {
newVolume = VOLUME_MAX; newVolume = VOLUME_MAX;
if (newVolume < VOLUME_MIN) }
if (newVolume < VOLUME_MIN) {
newVolume = VOLUME_MIN; newVolume = VOLUME_MIN;
}
#ifdef OPENAL_DEBUG #ifdef OPENAL_DEBUG
fprintf(stderr, "OPENAL: PlatDo3dSound: idx = %d, volume = %d, distance = %d\n", activeIndex, newVolume, distance); fprintf(stderr, "OPENAL: PlatDo3dSound: idx = %d, volume = %d, distance = %d\n", activeIndex, newVolume, distance);
@ -751,25 +761,23 @@ int PlatDo3dSound(int activeIndex)
} }
if (distance < ActiveSounds[activeIndex].threedeedata.outer_range) { if (distance < ActiveSounds[activeIndex].threedeedata.outer_range) {
#if 0 ActiveSounds[activeIndex].PropSetP_pos[0] = (ALfloat)relativePosn.vx;
ActiveSounds[activeIndex].PropSetP_pos[0] = ActiveSounds[activeIndex].threedeedata.position.vx; // 10000.0; ActiveSounds[activeIndex].PropSetP_pos[1] = (ALfloat)relativePosn.vy;
ActiveSounds[activeIndex].PropSetP_pos[1] = ActiveSounds[activeIndex].threedeedata.position.vy; // 10000.0; ActiveSounds[activeIndex].PropSetP_pos[2] = (ALfloat)relativePosn.vz;
ActiveSounds[activeIndex].PropSetP_pos[2] = ActiveSounds[activeIndex].threedeedata.position.vz; // 10000.0;
#endif
ActiveSounds[activeIndex].PropSetP_pos[0] = (ALfloat)relativePosn.vx / (ALfloat)distance;
ActiveSounds[activeIndex].PropSetP_pos[1] = (ALfloat)relativePosn.vy / (ALfloat)distance;
ActiveSounds[activeIndex].PropSetP_pos[2] = (ALfloat)relativePosn.vz / (ALfloat)distance;
alSourcefv (ActiveSounds[activeIndex].ds3DBufferP, AL_POSITION, ActiveSounds[activeIndex].PropSetP_pos); alSourcefv (ActiveSounds[activeIndex].ds3DBufferP, AL_POSITION, ActiveSounds[activeIndex].PropSetP_pos);
#ifdef OPENAL_DEBUG #ifdef OPENAL_DEBUG
fprintf(stderr, "OPENAL: Sound : (%f, %f, %f) [%d] [%d,%d]\n", ActiveSounds[activeIndex].PropSetP_pos[0], ActiveSounds[activeIndex].PropSetP_pos[1], ActiveSounds[activeIndex].PropSetP_pos[2], activeIndex, ActiveSounds[activeIndex].threedeedata.inner_range, ActiveSounds[activeIndex].threedeedata.outer_range); fprintf(stderr, "OPENAL: Sound : (%f, %f, %f) [%d] [%d,%d]\n", ActiveSounds[activeIndex].PropSetP_pos[0], ActiveSounds[activeIndex].PropSetP_pos[1], ActiveSounds[activeIndex].PropSetP_pos[2], activeIndex, ActiveSounds[activeIndex].threedeedata.inner_range, ActiveSounds[activeIndex].threedeedata.outer_range);
#endif #endif
ActiveSounds[activeIndex].PropSetP_vel[0] =
ActiveSounds[activeIndex].threedeedata.velocity.vx; // No doppler for now.
ActiveSounds[activeIndex].PropSetP_vel[1] = // ActiveSounds[activeIndex].PropSetP_vel[0] =
ActiveSounds[activeIndex].threedeedata.velocity.vy; // ActiveSounds[activeIndex].threedeedata.velocity.vx;
ActiveSounds[activeIndex].PropSetP_vel[2] = // ActiveSounds[activeIndex].PropSetP_vel[1] =
ActiveSounds[activeIndex].threedeedata.velocity.vz; // ActiveSounds[activeIndex].threedeedata.velocity.vy;
// ActiveSounds[activeIndex].PropSetP_vel[2] =
// ActiveSounds[activeIndex].threedeedata.velocity.vz;
// alSourcefv (ActiveSounds[activeIndex].ds3DBufferP, // alSourcefv (ActiveSounds[activeIndex].ds3DBufferP,
// AL_VELOCITY, ActiveSounds[activeIndex].PropSetP_vel); // AL_VELOCITY, ActiveSounds[activeIndex].PropSetP_vel);
} }
@ -825,11 +833,17 @@ void PlatUpdatePlayer()
#ifdef OPENAL_DEBUG #ifdef OPENAL_DEBUG
fprintf(stderr, "OPENAL: Player: (%f, %f, %f) (%f, %f, %f %f, %f, %f)\n", pos[0], pos[1], pos[2], or[0], or[1], or[2], or[3], or[4], or[5]); fprintf(stderr, "OPENAL: Player: (%f, %f, %f) (%f, %f, %f %f, %f, %f)\n", pos[0], pos[1], pos[2], or[0], or[1], or[2], or[3], or[4], or[5]);
#endif #endif
// fixme: add reverb check
pos[0] = 0.0f;
pos[1] = 0.0f;
pos[2] = 0.0f;
alListenerfv (AL_ORIENTATION, or); alListenerfv (AL_ORIENTATION, or);
// alListenerfv (AL_VELOCITY, vel); alListenerfv (AL_VELOCITY, vel);
/* alListenerfv (AL_POSITION, pos); */ alListenerfv (AL_POSITION, pos);
} }
// TODO: reverb handling
} }
void PlatEndGameSound(SOUNDINDEX index) void PlatEndGameSound(SOUNDINDEX index)
@ -839,13 +853,14 @@ void PlatEndGameSound(SOUNDINDEX index)
GameSounds[index].loaded = 0; GameSounds[index].loaded = 0;
GameSounds[index].dsFrequency = 0; GameSounds[index].dsFrequency = 0;
if (GameSounds[index].wavName) { if (GameSounds[index].wavName != NULL) {
DeallocateMem(GameSounds[index].wavName); DeallocateMem(GameSounds[index].wavName);
GameSounds[index].wavName = NULL; GameSounds[index].wavName = NULL;
} }
if (!SoundActivated) if (!SoundActivated) {
return; return;
}
if((index<0)||(index>=SID_MAXIMUM)) return; /* no such sound */ if((index<0)||(index>=SID_MAXIMUM)) return; /* no such sound */
@ -896,6 +911,7 @@ void InitialiseBaseFrequency(SOUNDINDEX soundNum)
void PlatSetEnviroment(unsigned int env_index, float reverb_mix) void PlatSetEnviroment(unsigned int env_index, float reverb_mix)
{ {
// TODO: implement
#ifdef OPENAL_DEBUG #ifdef OPENAL_DEBUG
fprintf(stderr, "OPENAL: PlatSetEnvironment(%d, %f)\n", env_index, reverb_mix); fprintf(stderr, "OPENAL: PlatSetEnvironment(%d, %f)\n", env_index, reverb_mix);
#endif #endif
@ -911,17 +927,20 @@ void UpdateSoundFrequencies()
fprintf(stderr, "OPENAL: UpdateSoundFreqncies()\n"); fprintf(stderr, "OPENAL: UpdateSoundFreqncies()\n");
#endif #endif
if (!SoundActivated) if (!SoundActivated) {
return; return;
}
if (!SoundSwitchedOn) if (!SoundSwitchedOn) {
return; return;
}
for (i = 0; i < SOUND_MAXACTIVE; i++) { for (i = 0; i < SOUND_MAXACTIVE; i++) {
int gameIndex = ActiveSounds[i].soundIndex; int gameIndex = ActiveSounds[i].soundIndex;
if (gameIndex == SID_NOSOUND) if (gameIndex == SID_NOSOUND) {
continue; continue;
}
if (TimeScale != ONE_FIXED) { if (TimeScale != ONE_FIXED) {
#ifdef OPENAL_DEBUG #ifdef OPENAL_DEBUG
@ -929,9 +948,10 @@ void UpdateSoundFrequencies()
#endif #endif
} }
if (ActiveSounds[i].pitch != GameSounds[gameIndex].pitch) if (ActiveSounds[i].pitch != GameSounds[gameIndex].pitch) {
PlatChangeSoundPitch(i,ActiveSounds[i].pitch); PlatChangeSoundPitch(i,ActiveSounds[i].pitch);
} }
}
} }
static int LoadWAV( ALvoid* data, ALvoid** bufferPtr, ALushort* format, ALushort* freq, int* len, int* seclen ) static int LoadWAV( ALvoid* data, ALvoid** bufferPtr, ALushort* format, ALushort* freq, int* len, int* seclen )
@ -988,25 +1008,32 @@ int LoadWavFile(int soundNum, char * wavFileName)
ALvoid *data, *bufferPtr; ALvoid *data, *bufferPtr;
int len, seclen; int len, seclen;
FILE *fp; FILE *fp;
char* wavname; const char* wavname;
#ifdef OPENAL_DEBUG #ifdef OPENAL_DEBUG
fprintf(stderr, "LoadWavFile(%d, %s) - sound\n", soundNum, wavFileName); fprintf(stderr, "LoadWavFile(%d, %s) - sound\n", soundNum, wavFileName);
#endif #endif
if (!SoundActivated) if (!SoundActivated) {
return 0; return 0;
}
/* TODO: Perm for now, until custom rifs can be loaded in ~/.avp */ /* TODO: Perm for now, until custom rifs can be loaded in ~/.avp */
fp = OpenGameFile(wavFileName, FILEMODE_READONLY, FILETYPE_PERM); fp = OpenGameFile(wavFileName, FILEMODE_READONLY, FILETYPE_PERM);
if (fp == NULL) if (fp == NULL) {
return 0; return 0;
}
fseek(fp, 0, SEEK_END); fseek(fp, 0, SEEK_END);
len = ftell(fp); len = ftell(fp);
rewind(fp); rewind(fp);
data = malloc(len); data = (ALvoid*) malloc(len);
if( data == NULL ) {
fclose(fp);
return 0;
}
fread(data, 1, len, fp); fread(data, 1, len, fp);
fclose(fp); fclose(fp);
@ -1015,29 +1042,32 @@ int LoadWavFile(int soundNum, char * wavFileName)
return 0; return 0;
} }
alGenBuffers (1, &(GameSounds[soundNum].dsBufferP)); alGenBuffers(1, &(GameSounds[soundNum].dsBufferP));
alBufferData (GameSounds[soundNum].dsBufferP, format, bufferPtr, len, freq); alBufferData(GameSounds[soundNum].dsBufferP, format, bufferPtr, len, freq);
wavname = strrchr (wavFileName, '\\'); // get the basename of the filename
if (wavname) wavname = strrchr(wavFileName, '\\');
if (wavname != NULL) {
wavname++; wavname++;
else } else {
wavname = wavFileName; wavname = wavFileName;
GameSounds[soundNum].wavName = (char *)AllocateMem (strlen (wavname) + 1); }
strcpy (GameSounds[soundNum].wavName, wavname);
GameSounds[soundNum].wavName = (char *)AllocateMem(strlen(wavname) + 1);
strcpy(GameSounds[soundNum].wavName, wavname);
GameSounds[soundNum].flags = SAMPLE_IN_HW; GameSounds[soundNum].flags = SAMPLE_IN_HW;
GameSounds[soundNum].length = (seclen != 0) ? seclen : 1; GameSounds[soundNum].length = (seclen != 0) ? seclen : 1;
GameSounds[soundNum].dsFrequency = freq; GameSounds[soundNum].dsFrequency = freq;
free (data); free(data);
return 1; return 1;
} }
unsigned char *ExtractWavFile(int soundIndex, unsigned char *bufferPtr) unsigned char *ExtractWavFile(int soundIndex, unsigned char *bufferPtr)
{ {
ALint len, seclen = 0; ALint len, seclen;
void *udata; void *udata;
ALushort rfmt, rfreq; ALushort rfmt, rfreq;
size_t slen; size_t slen;
@ -1046,13 +1076,14 @@ unsigned char *ExtractWavFile(int soundIndex, unsigned char *bufferPtr)
fprintf(stderr, "OPENAL: ExtractWavFile(%d, %p)\n", soundIndex, bufferPtr); fprintf(stderr, "OPENAL: ExtractWavFile(%d, %p)\n", soundIndex, bufferPtr);
#endif #endif
if (!SoundActivated) {
return 0;
}
slen = strlen (bufferPtr) + 1; slen = strlen (bufferPtr) + 1;
GameSounds[soundIndex].wavName = (char *)AllocateMem (slen); GameSounds[soundIndex].wavName = (char *)AllocateMem (slen);
strcpy (GameSounds[soundIndex].wavName, bufferPtr); strcpy (GameSounds[soundIndex].wavName, bufferPtr);
if (!SoundActivated)
return 0;
bufferPtr += slen; bufferPtr += slen;
#ifdef OPENAL_DEBUG #ifdef OPENAL_DEBUG
@ -1060,15 +1091,15 @@ fprintf(stderr, "OPENAL: Loaded %s\n", GameSounds[soundIndex].wavName);
#endif #endif
if( LoadWAV( bufferPtr, &udata, &rfmt, &rfreq, &len, &seclen ) ) { if( LoadWAV( bufferPtr, &udata, &rfmt, &rfreq, &len, &seclen ) ) {
alGenBuffers (1, &(GameSounds[soundIndex].dsBufferP));
alBufferData (GameSounds[soundIndex].dsBufferP,
rfmt, udata, len, rfreq);
/* GameSounds[soundIndex].loaded = 1; */ alGenBuffers(1, &(GameSounds[soundIndex].dsBufferP));
alBufferData (GameSounds[soundIndex].dsBufferP, rfmt, udata, len, rfreq);
//GameSounds[soundIndex].loaded = 1;
GameSounds[soundIndex].flags = SAMPLE_IN_HW; GameSounds[soundIndex].flags = SAMPLE_IN_HW;
GameSounds[soundIndex].length = (seclen != 0) ? seclen : 1; GameSounds[soundIndex].length = (seclen != 0) ? seclen : 1;
GameSounds[soundIndex].dsFrequency = rfreq; GameSounds[soundIndex].dsFrequency = rfreq;
/* GameSounds[soundIndex].pitch = PITCH_DEFAULTPLAT; */ //GameSounds[soundIndex].pitch = PITCH_DEFAULTPLAT;
} }
/* read RIFF chunk length and jump past it */ /* read RIFF chunk length and jump past it */