mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2024-12-03 09:22:45 +00:00
Misc changes
This commit is contained in:
parent
00a459c61b
commit
c47e78d6f3
1 changed files with 14 additions and 2 deletions
|
@ -346,6 +346,7 @@ int idSoundVoice_OpenAL::SubmitBuffer( idSoundSample_OpenAL* sample, int bufferN
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
idSoundSystemLocal::bufferContext_t* bufferContext = soundSystemLocal.ObtainStreamBufferContext();
|
||||
if( bufferContext == NULL )
|
||||
{
|
||||
|
@ -356,6 +357,7 @@ int idSoundVoice_OpenAL::SubmitBuffer( idSoundSample_OpenAL* sample, int bufferN
|
|||
bufferContext->voice = this;
|
||||
bufferContext->sample = sample;
|
||||
bufferContext->bufferNumber = bufferNumber;
|
||||
#endif
|
||||
|
||||
// TODO openal stream
|
||||
|
||||
|
@ -379,13 +381,23 @@ int idSoundVoice_OpenAL::SubmitBuffer( idSoundSample_OpenAL* sample, int bufferN
|
|||
|
||||
if( sample->format.basic.formatTag == idWaveFile::FORMAT_PCM )
|
||||
{
|
||||
format = sample->NumChannels() == 1 ? AL_FORMAT_MONO_IMA4 : AL_FORMAT_STEREO_IMA4;
|
||||
format = sample->NumChannels() == 1 ? AL_FORMAT_MONO16 : AL_FORMAT_STEREO16;
|
||||
}
|
||||
else if( sample->format.basic.formatTag == idWaveFile::FORMAT_ADPCM )
|
||||
{
|
||||
format = sample->NumChannels() == 1 ? AL_FORMAT_MONO16 : AL_FORMAT_STEREO16;
|
||||
}
|
||||
else if( sample->format.basic.formatTag == idWaveFile::FORMAT_XMA2 )
|
||||
{
|
||||
format = sample->NumChannels() == 1 ? AL_FORMAT_MONO16 : AL_FORMAT_STEREO16;
|
||||
}
|
||||
else
|
||||
{
|
||||
format = sample->NumChannels() == 1 ? AL_FORMAT_MONO16 : AL_FORMAT_STEREO16;
|
||||
}
|
||||
|
||||
int rate = sample->SampleRate(); /*44100*/
|
||||
|
||||
for( int j = 0; j < finishedbuffers && j < 1; j++ )
|
||||
{
|
||||
/*
|
||||
|
@ -406,7 +418,7 @@ int idSoundVoice_OpenAL::SubmitBuffer( idSoundSample_OpenAL* sample, int bufferN
|
|||
|
||||
|
||||
|
||||
alBufferData( openalStreamingBuffer[j], format, sample->buffers[bufferNumber].buffer, sample->buffers[bufferNumber].bufferSize, sample->SampleRate() /*44100*/ );
|
||||
alBufferData( openalStreamingBuffer[j], format, sample->buffers[bufferNumber].buffer, sample->buffers[bufferNumber].bufferSize, rate );
|
||||
//openalStreamingOffset += MIXBUFFER_SAMPLES;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue