Merge pull request #2659 from Armada651/openal-conv

OpenALStream: Fix sample conversion.
This commit is contained in:
Jules Blok 2015-06-27 00:13:02 +02:00
commit a71e81a143
1 changed files with 1 additions and 1 deletions

View File

@ -295,7 +295,7 @@ void OpenALStream::SoundLoop()
// Convert the samples from float to short
short stereo[OAL_MAX_SAMPLES * STEREO_CHANNELS * OAL_MAX_BUFFERS];
for (u32 i = 0; i < nSamples * STEREO_CHANNELS; ++i)
stereo[i] = (short)((float)sampleBuffer[i] * (1 << 16));
stereo[i] = (short)((float)sampleBuffer[i] * (1 << 15));
alBufferData(uiBufferTemp[iBuffersFilled], AL_FORMAT_STEREO16, stereo, nSamples * FRAME_STEREO_SHORT, ulFrequency);
}