mirror of https://github.com/axmolengine/axmol.git
fix #89
This commit is contained in:
parent
6987372798
commit
5a0bdc1e81
|
@ -145,7 +145,11 @@ void AudioCache::readDataTask(unsigned int selfId)
|
|||
uint32_t remainingFrames = totalFrames;
|
||||
uint32_t adjustFrames = 0;
|
||||
|
||||
_format = channelCount > 1 ? AL_FORMAT_STEREO16 : AL_FORMAT_MONO16;
|
||||
if(bytesPerFrame > 1)
|
||||
_format = channelCount > 1 ? AL_FORMAT_STEREO16 : AL_FORMAT_MONO16; // bits depth: 16bits
|
||||
else
|
||||
_format = channelCount > 1 ? AL_FORMAT_STEREO8 : AL_FORMAT_MONO8; // bits depth: 8bits
|
||||
|
||||
_sampleRate = (ALsizei)sampleRate;
|
||||
_duration = 1.0f * totalFrames / sampleRate;
|
||||
_totalFrames = totalFrames;
|
||||
|
|
Loading…
Reference in New Issue