223 |
const sf_count_t bufsize = CONVERT_BUFFER_SIZE / ChannelCount; |
const sf_count_t bufsize = CONVERT_BUFFER_SIZE / ChannelCount; |
224 |
unsigned char* const dst = static_cast<unsigned char*>(pBuffer); |
unsigned char* const dst = static_cast<unsigned char*>(pBuffer); |
225 |
while (count > 0) { |
while (count > 0) { |
226 |
int n = sf_readf_int(pSndFile, pConvertBuffer, std::min(count, bufsize)); |
int n = (int) sf_readf_int(pSndFile, pConvertBuffer, std::min(count, bufsize)); |
227 |
if (n <= 0) break; |
if (n <= 0) break; |
228 |
for (int i = 0 ; i < n * ChannelCount ; i++) { |
for (int i = 0 ; i < n * ChannelCount ; i++) { |
229 |
dst[j++] = pConvertBuffer[i] >> 8; |
dst[j++] = pConvertBuffer[i] >> 8; |
236 |
} else |
} else |
237 |
#endif |
#endif |
238 |
{ |
{ |
239 |
int bytes = sf_read_raw(pSndFile, pBuffer, FrameCount * GetFrameSize()); |
int bytes = (int)sf_read_raw(pSndFile, pBuffer, FrameCount * GetFrameSize()); |
240 |
return bytes / GetFrameSize(); |
return bytes / GetFrameSize(); |
241 |
} |
} |
242 |
} |
} |