mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 09:14:04 +02:00
Update extras.
This commit is contained in:
+59
-55
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
WAV audio loader and writer. Choice of public domain or MIT-0. See license statements at the end of this file.
|
||||
dr_wav - v0.12.2 - 2020-04-21
|
||||
dr_wav - v0.12.3 - 2020-04-30
|
||||
|
||||
David Reid - mackron@gmail.com
|
||||
|
||||
@@ -905,18 +905,18 @@ DRWAV_API drwav_int32* drwav_open_memory_and_read_pcm_frames_s32(const void* dat
|
||||
DRWAV_API void drwav_free(void* p, const drwav_allocation_callbacks* pAllocationCallbacks);
|
||||
|
||||
/* Converts bytes from a wav stream to a sized type of native endian. */
|
||||
DRWAV_API drwav_uint16 drwav_bytes_to_u16(const unsigned char* data);
|
||||
DRWAV_API drwav_int16 drwav_bytes_to_s16(const unsigned char* data);
|
||||
DRWAV_API drwav_uint32 drwav_bytes_to_u32(const unsigned char* data);
|
||||
DRWAV_API drwav_int32 drwav_bytes_to_s32(const unsigned char* data);
|
||||
DRWAV_API drwav_uint64 drwav_bytes_to_u64(const unsigned char* data);
|
||||
DRWAV_API drwav_int64 drwav_bytes_to_s64(const unsigned char* data);
|
||||
DRWAV_API drwav_uint16 drwav_bytes_to_u16(const drwav_uint8* data);
|
||||
DRWAV_API drwav_int16 drwav_bytes_to_s16(const drwav_uint8* data);
|
||||
DRWAV_API drwav_uint32 drwav_bytes_to_u32(const drwav_uint8* data);
|
||||
DRWAV_API drwav_int32 drwav_bytes_to_s32(const drwav_uint8* data);
|
||||
DRWAV_API drwav_uint64 drwav_bytes_to_u64(const drwav_uint8* data);
|
||||
DRWAV_API drwav_int64 drwav_bytes_to_s64(const drwav_uint8* data);
|
||||
|
||||
/* Compares a GUID for the purpose of checking the type of a Wave64 chunk. */
|
||||
DRWAV_API drwav_bool32 drwav_guid_equal(const drwav_uint8 a[16], const drwav_uint8 b[16]);
|
||||
|
||||
/* Compares a four-character-code for the purpose of checking the type of a RIFF chunk. */
|
||||
DRWAV_API drwav_bool32 drwav_fourcc_equal(const unsigned char* a, const char* b);
|
||||
DRWAV_API drwav_bool32 drwav_fourcc_equal(const drwav_uint8* a, const char* b);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@@ -1071,7 +1071,7 @@ static DRWAV_INLINE drwav_bool32 drwav__guid_equal(const drwav_uint8 a[16], cons
|
||||
return DRWAV_TRUE;
|
||||
}
|
||||
|
||||
static DRWAV_INLINE drwav_bool32 drwav__fourcc_equal(const unsigned char* a, const char* b)
|
||||
static DRWAV_INLINE drwav_bool32 drwav__fourcc_equal(const drwav_uint8* a, const char* b)
|
||||
{
|
||||
return
|
||||
a[0] == b[0] &&
|
||||
@@ -1094,39 +1094,39 @@ static DRWAV_INLINE int drwav__is_little_endian(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static DRWAV_INLINE drwav_uint16 drwav__bytes_to_u16(const unsigned char* data)
|
||||
static DRWAV_INLINE drwav_uint16 drwav__bytes_to_u16(const drwav_uint8* data)
|
||||
{
|
||||
return (data[0] << 0) | (data[1] << 8);
|
||||
}
|
||||
|
||||
static DRWAV_INLINE drwav_int16 drwav__bytes_to_s16(const unsigned char* data)
|
||||
static DRWAV_INLINE drwav_int16 drwav__bytes_to_s16(const drwav_uint8* data)
|
||||
{
|
||||
return (short)drwav__bytes_to_u16(data);
|
||||
}
|
||||
|
||||
static DRWAV_INLINE drwav_uint32 drwav__bytes_to_u32(const unsigned char* data)
|
||||
static DRWAV_INLINE drwav_uint32 drwav__bytes_to_u32(const drwav_uint8* data)
|
||||
{
|
||||
return (data[0] << 0) | (data[1] << 8) | (data[2] << 16) | (data[3] << 24);
|
||||
}
|
||||
|
||||
static DRWAV_INLINE drwav_int32 drwav__bytes_to_s32(const unsigned char* data)
|
||||
static DRWAV_INLINE drwav_int32 drwav__bytes_to_s32(const drwav_uint8* data)
|
||||
{
|
||||
return (drwav_int32)drwav__bytes_to_u32(data);
|
||||
}
|
||||
|
||||
static DRWAV_INLINE drwav_uint64 drwav__bytes_to_u64(const unsigned char* data)
|
||||
static DRWAV_INLINE drwav_uint64 drwav__bytes_to_u64(const drwav_uint8* data)
|
||||
{
|
||||
return
|
||||
((drwav_uint64)data[0] << 0) | ((drwav_uint64)data[1] << 8) | ((drwav_uint64)data[2] << 16) | ((drwav_uint64)data[3] << 24) |
|
||||
((drwav_uint64)data[4] << 32) | ((drwav_uint64)data[5] << 40) | ((drwav_uint64)data[6] << 48) | ((drwav_uint64)data[7] << 56);
|
||||
}
|
||||
|
||||
static DRWAV_INLINE drwav_int64 drwav__bytes_to_s64(const unsigned char* data)
|
||||
static DRWAV_INLINE drwav_int64 drwav__bytes_to_s64(const drwav_uint8* data)
|
||||
{
|
||||
return (drwav_int64)drwav__bytes_to_u64(data);
|
||||
}
|
||||
|
||||
static DRWAV_INLINE void drwav__bytes_to_guid(const unsigned char* data, drwav_uint8* guid)
|
||||
static DRWAV_INLINE void drwav__bytes_to_guid(const drwav_uint8* data, drwav_uint8* guid)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 16; ++i) {
|
||||
@@ -1495,7 +1495,7 @@ static drwav_bool32 drwav_init_write__internal(drwav* pWav, const drwav_data_for
|
||||
static drwav_result drwav__read_chunk_header(drwav_read_proc onRead, void* pUserData, drwav_container container, drwav_uint64* pRunningBytesReadOut, drwav_chunk_header* pHeaderOut)
|
||||
{
|
||||
if (container == drwav_container_riff) {
|
||||
unsigned char sizeInBytes[4];
|
||||
drwav_uint8 sizeInBytes[4];
|
||||
|
||||
if (onRead(pUserData, pHeaderOut->id.fourcc, 4) != 4) {
|
||||
return DRWAV_AT_END;
|
||||
@@ -1509,7 +1509,7 @@ static drwav_result drwav__read_chunk_header(drwav_read_proc onRead, void* pUser
|
||||
pHeaderOut->paddingSize = drwav__chunk_padding_size_riff(pHeaderOut->sizeInBytes);
|
||||
*pRunningBytesReadOut += 8;
|
||||
} else {
|
||||
unsigned char sizeInBytes[8];
|
||||
drwav_uint8 sizeInBytes[8];
|
||||
|
||||
if (onRead(pUserData, pHeaderOut->id.guid, 16) != 16) {
|
||||
return DRWAV_AT_END;
|
||||
@@ -1578,7 +1578,7 @@ static drwav_bool32 drwav__seek_from_start(drwav_seek_proc onSeek, drwav_uint64
|
||||
static drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSeek, void* pUserData, drwav_container container, drwav_uint64* pRunningBytesReadOut, drwav_fmt* fmtOut)
|
||||
{
|
||||
drwav_chunk_header header;
|
||||
unsigned char fmt[16];
|
||||
drwav_uint8 fmt[16];
|
||||
|
||||
if (drwav__read_chunk_header(onRead, pUserData, container, pRunningBytesReadOut, &header) != DRWAV_SUCCESS) {
|
||||
return DRWAV_FALSE;
|
||||
@@ -1629,7 +1629,7 @@ static drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSe
|
||||
memset(fmtOut->subFormat, 0, sizeof(fmtOut->subFormat));
|
||||
|
||||
if (header.sizeInBytes > 16) {
|
||||
unsigned char fmt_cbSize[2];
|
||||
drwav_uint8 fmt_cbSize[2];
|
||||
int bytesReadSoFar = 0;
|
||||
|
||||
if (onRead(pUserData, fmt_cbSize, sizeof(fmt_cbSize)) != sizeof(fmt_cbSize)) {
|
||||
@@ -1649,7 +1649,7 @@ static drwav_bool32 drwav__read_fmt(drwav_read_proc onRead, drwav_seek_proc onSe
|
||||
}
|
||||
|
||||
if (fmtOut->formatTag == DR_WAVE_FORMAT_EXTENSIBLE) {
|
||||
unsigned char fmtext[22];
|
||||
drwav_uint8 fmtext[22];
|
||||
if (onRead(pUserData, fmtext, fmtOut->extendedSize) != fmtOut->extendedSize) {
|
||||
return DRWAV_FALSE; /* Expecting more data. */
|
||||
}
|
||||
@@ -1771,7 +1771,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk,
|
||||
|
||||
drwav_uint64 cursor; /* <-- Keeps track of the byte position so we can seek to specific locations. */
|
||||
drwav_bool32 sequential;
|
||||
unsigned char riff[4];
|
||||
drwav_uint8 riff[4];
|
||||
drwav_fmt fmt;
|
||||
unsigned short translatedFormatTag;
|
||||
drwav_uint64 sampleCountFromFactChunk;
|
||||
@@ -1815,8 +1815,8 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk,
|
||||
|
||||
|
||||
if (pWav->container == drwav_container_riff) {
|
||||
unsigned char chunkSizeBytes[4];
|
||||
unsigned char wave[4];
|
||||
drwav_uint8 chunkSizeBytes[4];
|
||||
drwav_uint8 wave[4];
|
||||
|
||||
/* RIFF/WAVE */
|
||||
if (drwav__on_read(pWav->onRead, pWav->pUserData, chunkSizeBytes, sizeof(chunkSizeBytes), &cursor) != sizeof(chunkSizeBytes)) {
|
||||
@@ -1835,7 +1835,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk,
|
||||
return DRWAV_FALSE; /* Expecting "WAVE". */
|
||||
}
|
||||
} else {
|
||||
unsigned char chunkSizeBytes[8];
|
||||
drwav_uint8 chunkSizeBytes[8];
|
||||
drwav_uint8 wave[16];
|
||||
|
||||
/* W64 */
|
||||
@@ -1984,7 +1984,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk,
|
||||
/* "smpl" chunk. */
|
||||
if (pWav->container == drwav_container_riff) {
|
||||
if (drwav__fourcc_equal(header.id.fourcc, "smpl")) {
|
||||
unsigned char smplHeaderData[36]; /* 36 = size of the smpl header section, not including the loop data. */
|
||||
drwav_uint8 smplHeaderData[36]; /* 36 = size of the smpl header section, not including the loop data. */
|
||||
if (chunkSize >= sizeof(smplHeaderData)) {
|
||||
drwav_uint64 bytesJustRead = drwav__on_read(pWav->onRead, pWav->pUserData, smplHeaderData, sizeof(smplHeaderData), &cursor);
|
||||
chunkSize -= bytesJustRead;
|
||||
@@ -2003,7 +2003,7 @@ static drwav_bool32 drwav_init__internal(drwav* pWav, drwav_chunk_proc onChunk,
|
||||
pWav->smpl.samplerData = drwav__bytes_to_u32(smplHeaderData+32);
|
||||
|
||||
for (iLoop = 0; iLoop < pWav->smpl.numSampleLoops && iLoop < drwav_countof(pWav->smpl.loops); ++iLoop) {
|
||||
unsigned char smplLoopData[24]; /* 24 = size of a loop section in the smpl chunk. */
|
||||
drwav_uint8 smplLoopData[24]; /* 24 = size of a loop section in the smpl chunk. */
|
||||
bytesJustRead = drwav__on_read(pWav->onRead, pWav->pUserData, smplLoopData, sizeof(smplLoopData), &cursor);
|
||||
chunkSize -= bytesJustRead;
|
||||
|
||||
@@ -2348,7 +2348,8 @@ DRWAV_API drwav_bool32 drwav_init_write_sequential_pcm_frames(drwav* pWav, const
|
||||
|
||||
DRWAV_API drwav_uint64 drwav_target_write_size_bytes(const drwav_data_format* pFormat, drwav_uint64 totalSampleCount)
|
||||
{
|
||||
drwav_uint64 targetDataSizeBytes = (drwav_uint64)(totalSampleCount * pFormat->channels * pFormat->bitsPerSample/8.0);
|
||||
/* Casting totalSampleCount to drwav_int64 for VC6 compatibility. No issues in practice because nobody is going to exhaust the whole 63 bits. */
|
||||
drwav_uint64 targetDataSizeBytes = (drwav_uint64)((drwav_int64)totalSampleCount * pFormat->channels * pFormat->bitsPerSample/8.0);
|
||||
drwav_uint64 riffChunkSizeBytes;
|
||||
drwav_uint64 fileSizeBytes;
|
||||
|
||||
@@ -3195,7 +3196,7 @@ DRWAV_API drwav_bool32 drwav_init_memory_ex(drwav* pWav, const void* data, size_
|
||||
return DRWAV_FALSE;
|
||||
}
|
||||
|
||||
pWav->memoryStream.data = (const unsigned char*)data;
|
||||
pWav->memoryStream.data = (const drwav_uint8*)data;
|
||||
pWav->memoryStream.dataSize = dataSize;
|
||||
pWav->memoryStream.currentReadPos = 0;
|
||||
|
||||
@@ -4009,7 +4010,7 @@ static DRWAV_INLINE drwav_int16 drwav__mulaw_to_s16(drwav_uint8 sampleIn)
|
||||
|
||||
|
||||
|
||||
static void drwav__pcm_to_s16(drwav_int16* pOut, const unsigned char* pIn, size_t totalSampleCount, unsigned int bytesPerSample)
|
||||
static void drwav__pcm_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
@@ -4061,7 +4062,7 @@ static void drwav__pcm_to_s16(drwav_int16* pOut, const unsigned char* pIn, size_
|
||||
}
|
||||
}
|
||||
|
||||
static void drwav__ieee_to_s16(drwav_int16* pOut, const unsigned char* pIn, size_t totalSampleCount, unsigned int bytesPerSample)
|
||||
static void drwav__ieee_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample)
|
||||
{
|
||||
if (bytesPerSample == 4) {
|
||||
drwav_f32_to_s16(pOut, (const float*)pIn, totalSampleCount);
|
||||
@@ -4080,7 +4081,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__pcm(drwav* pWav, drwav_uint64 fra
|
||||
{
|
||||
drwav_uint32 bytesPerFrame;
|
||||
drwav_uint64 totalFramesRead;
|
||||
unsigned char sampleData[4096];
|
||||
drwav_uint8 sampleData[4096];
|
||||
|
||||
/* Fast path. */
|
||||
if (pWav->translatedFormatTag == DR_WAVE_FORMAT_PCM && pWav->bitsPerSample == 16) {
|
||||
@@ -4113,7 +4114,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__pcm(drwav* pWav, drwav_uint64 fra
|
||||
static drwav_uint64 drwav_read_pcm_frames_s16__ieee(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut)
|
||||
{
|
||||
drwav_uint64 totalFramesRead;
|
||||
unsigned char sampleData[4096];
|
||||
drwav_uint8 sampleData[4096];
|
||||
|
||||
drwav_uint32 bytesPerFrame = drwav_get_bytes_per_pcm_frame(pWav);
|
||||
if (bytesPerFrame == 0) {
|
||||
@@ -4141,7 +4142,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__ieee(drwav* pWav, drwav_uint64 fr
|
||||
static drwav_uint64 drwav_read_pcm_frames_s16__alaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut)
|
||||
{
|
||||
drwav_uint64 totalFramesRead;
|
||||
unsigned char sampleData[4096];
|
||||
drwav_uint8 sampleData[4096];
|
||||
|
||||
drwav_uint32 bytesPerFrame = drwav_get_bytes_per_pcm_frame(pWav);
|
||||
if (bytesPerFrame == 0) {
|
||||
@@ -4169,7 +4170,7 @@ static drwav_uint64 drwav_read_pcm_frames_s16__alaw(drwav* pWav, drwav_uint64 fr
|
||||
static drwav_uint64 drwav_read_pcm_frames_s16__mulaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int16* pBufferOut)
|
||||
{
|
||||
drwav_uint64 totalFramesRead;
|
||||
unsigned char sampleData[4096];
|
||||
drwav_uint8 sampleData[4096];
|
||||
|
||||
drwav_uint32 bytesPerFrame = drwav_get_bytes_per_pcm_frame(pWav);
|
||||
if (bytesPerFrame == 0) {
|
||||
@@ -4270,7 +4271,7 @@ DRWAV_API void drwav_s24_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, size_
|
||||
int r;
|
||||
size_t i;
|
||||
for (i = 0; i < sampleCount; ++i) {
|
||||
int x = ((int)(((unsigned int)(((const unsigned char*)pIn)[i*3+0]) << 8) | ((unsigned int)(((const unsigned char*)pIn)[i*3+1]) << 16) | ((unsigned int)(((const unsigned char*)pIn)[i*3+2])) << 24)) >> 8;
|
||||
int x = ((int)(((unsigned int)(((const drwav_uint8*)pIn)[i*3+0]) << 8) | ((unsigned int)(((const drwav_uint8*)pIn)[i*3+1]) << 16) | ((unsigned int)(((const drwav_uint8*)pIn)[i*3+2])) << 24)) >> 8;
|
||||
r = x >> 8;
|
||||
pOut[i] = (short)r;
|
||||
}
|
||||
@@ -4335,7 +4336,7 @@ DRWAV_API void drwav_mulaw_to_s16(drwav_int16* pOut, const drwav_uint8* pIn, siz
|
||||
|
||||
|
||||
|
||||
static void drwav__pcm_to_f32(float* pOut, const unsigned char* pIn, size_t sampleCount, unsigned int bytesPerSample)
|
||||
static void drwav__pcm_to_f32(float* pOut, const drwav_uint8* pIn, size_t sampleCount, unsigned int bytesPerSample)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
@@ -4384,7 +4385,7 @@ static void drwav__pcm_to_f32(float* pOut, const unsigned char* pIn, size_t samp
|
||||
}
|
||||
}
|
||||
|
||||
static void drwav__ieee_to_f32(float* pOut, const unsigned char* pIn, size_t sampleCount, unsigned int bytesPerSample)
|
||||
static void drwav__ieee_to_f32(float* pOut, const drwav_uint8* pIn, size_t sampleCount, unsigned int bytesPerSample)
|
||||
{
|
||||
if (bytesPerSample == 4) {
|
||||
unsigned int i;
|
||||
@@ -4406,7 +4407,7 @@ static void drwav__ieee_to_f32(float* pOut, const unsigned char* pIn, size_t sam
|
||||
static drwav_uint64 drwav_read_pcm_frames_f32__pcm(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut)
|
||||
{
|
||||
drwav_uint64 totalFramesRead;
|
||||
unsigned char sampleData[4096];
|
||||
drwav_uint8 sampleData[4096];
|
||||
|
||||
drwav_uint32 bytesPerFrame = drwav_get_bytes_per_pcm_frame(pWav);
|
||||
if (bytesPerFrame == 0) {
|
||||
@@ -4482,7 +4483,7 @@ static drwav_uint64 drwav_read_pcm_frames_f32__ima(drwav* pWav, drwav_uint64 fra
|
||||
static drwav_uint64 drwav_read_pcm_frames_f32__ieee(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut)
|
||||
{
|
||||
drwav_uint64 totalFramesRead;
|
||||
unsigned char sampleData[4096];
|
||||
drwav_uint8 sampleData[4096];
|
||||
drwav_uint32 bytesPerFrame;
|
||||
|
||||
/* Fast path. */
|
||||
@@ -4516,7 +4517,7 @@ static drwav_uint64 drwav_read_pcm_frames_f32__ieee(drwav* pWav, drwav_uint64 fr
|
||||
static drwav_uint64 drwav_read_pcm_frames_f32__alaw(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut)
|
||||
{
|
||||
drwav_uint64 totalFramesRead;
|
||||
unsigned char sampleData[4096];
|
||||
drwav_uint8 sampleData[4096];
|
||||
drwav_uint32 bytesPerFrame = drwav_get_bytes_per_pcm_frame(pWav);
|
||||
if (bytesPerFrame == 0) {
|
||||
return 0;
|
||||
@@ -4543,7 +4544,7 @@ static drwav_uint64 drwav_read_pcm_frames_f32__alaw(drwav* pWav, drwav_uint64 fr
|
||||
static drwav_uint64 drwav_read_pcm_frames_f32__mulaw(drwav* pWav, drwav_uint64 framesToRead, float* pBufferOut)
|
||||
{
|
||||
drwav_uint64 totalFramesRead;
|
||||
unsigned char sampleData[4096];
|
||||
drwav_uint8 sampleData[4096];
|
||||
|
||||
drwav_uint32 bytesPerFrame = drwav_get_bytes_per_pcm_frame(pWav);
|
||||
if (bytesPerFrame == 0) {
|
||||
@@ -4736,7 +4737,7 @@ DRWAV_API void drwav_mulaw_to_f32(float* pOut, const drwav_uint8* pIn, size_t sa
|
||||
|
||||
|
||||
|
||||
static void drwav__pcm_to_s32(drwav_int32* pOut, const unsigned char* pIn, size_t totalSampleCount, unsigned int bytesPerSample)
|
||||
static void drwav__pcm_to_s32(drwav_int32* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
@@ -4787,7 +4788,7 @@ static void drwav__pcm_to_s32(drwav_int32* pOut, const unsigned char* pIn, size_
|
||||
}
|
||||
}
|
||||
|
||||
static void drwav__ieee_to_s32(drwav_int32* pOut, const unsigned char* pIn, size_t totalSampleCount, unsigned int bytesPerSample)
|
||||
static void drwav__ieee_to_s32(drwav_int32* pOut, const drwav_uint8* pIn, size_t totalSampleCount, unsigned int bytesPerSample)
|
||||
{
|
||||
if (bytesPerSample == 4) {
|
||||
drwav_f32_to_s32(pOut, (const float*)pIn, totalSampleCount);
|
||||
@@ -4806,7 +4807,7 @@ static void drwav__ieee_to_s32(drwav_int32* pOut, const unsigned char* pIn, size
|
||||
static drwav_uint64 drwav_read_pcm_frames_s32__pcm(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut)
|
||||
{
|
||||
drwav_uint64 totalFramesRead;
|
||||
unsigned char sampleData[4096];
|
||||
drwav_uint8 sampleData[4096];
|
||||
drwav_uint32 bytesPerFrame;
|
||||
|
||||
/* Fast path. */
|
||||
@@ -4888,7 +4889,7 @@ static drwav_uint64 drwav_read_pcm_frames_s32__ima(drwav* pWav, drwav_uint64 fra
|
||||
static drwav_uint64 drwav_read_pcm_frames_s32__ieee(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut)
|
||||
{
|
||||
drwav_uint64 totalFramesRead;
|
||||
unsigned char sampleData[4096];
|
||||
drwav_uint8 sampleData[4096];
|
||||
|
||||
drwav_uint32 bytesPerFrame = drwav_get_bytes_per_pcm_frame(pWav);
|
||||
if (bytesPerFrame == 0) {
|
||||
@@ -4916,7 +4917,7 @@ static drwav_uint64 drwav_read_pcm_frames_s32__ieee(drwav* pWav, drwav_uint64 fr
|
||||
static drwav_uint64 drwav_read_pcm_frames_s32__alaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut)
|
||||
{
|
||||
drwav_uint64 totalFramesRead;
|
||||
unsigned char sampleData[4096];
|
||||
drwav_uint8 sampleData[4096];
|
||||
|
||||
drwav_uint32 bytesPerFrame = drwav_get_bytes_per_pcm_frame(pWav);
|
||||
if (bytesPerFrame == 0) {
|
||||
@@ -4944,7 +4945,7 @@ static drwav_uint64 drwav_read_pcm_frames_s32__alaw(drwav* pWav, drwav_uint64 fr
|
||||
static drwav_uint64 drwav_read_pcm_frames_s32__mulaw(drwav* pWav, drwav_uint64 framesToRead, drwav_int32* pBufferOut)
|
||||
{
|
||||
drwav_uint64 totalFramesRead;
|
||||
unsigned char sampleData[4096];
|
||||
drwav_uint8 sampleData[4096];
|
||||
|
||||
drwav_uint32 bytesPerFrame = drwav_get_bytes_per_pcm_frame(pWav);
|
||||
if (bytesPerFrame == 0) {
|
||||
@@ -5521,32 +5522,32 @@ DRWAV_API void drwav_free(void* p, const drwav_allocation_callbacks* pAllocation
|
||||
}
|
||||
}
|
||||
|
||||
DRWAV_API drwav_uint16 drwav_bytes_to_u16(const unsigned char* data)
|
||||
DRWAV_API drwav_uint16 drwav_bytes_to_u16(const drwav_uint8* data)
|
||||
{
|
||||
return drwav__bytes_to_u16(data);
|
||||
}
|
||||
|
||||
DRWAV_API drwav_int16 drwav_bytes_to_s16(const unsigned char* data)
|
||||
DRWAV_API drwav_int16 drwav_bytes_to_s16(const drwav_uint8* data)
|
||||
{
|
||||
return drwav__bytes_to_s16(data);
|
||||
}
|
||||
|
||||
DRWAV_API drwav_uint32 drwav_bytes_to_u32(const unsigned char* data)
|
||||
DRWAV_API drwav_uint32 drwav_bytes_to_u32(const drwav_uint8* data)
|
||||
{
|
||||
return drwav__bytes_to_u32(data);
|
||||
}
|
||||
|
||||
DRWAV_API drwav_int32 drwav_bytes_to_s32(const unsigned char* data)
|
||||
DRWAV_API drwav_int32 drwav_bytes_to_s32(const drwav_uint8* data)
|
||||
{
|
||||
return drwav__bytes_to_s32(data);
|
||||
}
|
||||
|
||||
DRWAV_API drwav_uint64 drwav_bytes_to_u64(const unsigned char* data)
|
||||
DRWAV_API drwav_uint64 drwav_bytes_to_u64(const drwav_uint8* data)
|
||||
{
|
||||
return drwav__bytes_to_u64(data);
|
||||
}
|
||||
|
||||
DRWAV_API drwav_int64 drwav_bytes_to_s64(const unsigned char* data)
|
||||
DRWAV_API drwav_int64 drwav_bytes_to_s64(const drwav_uint8* data)
|
||||
{
|
||||
return drwav__bytes_to_s64(data);
|
||||
}
|
||||
@@ -5557,7 +5558,7 @@ DRWAV_API drwav_bool32 drwav_guid_equal(const drwav_uint8 a[16], const drwav_uin
|
||||
return drwav__guid_equal(a, b);
|
||||
}
|
||||
|
||||
DRWAV_API drwav_bool32 drwav_fourcc_equal(const unsigned char* a, const char* b)
|
||||
DRWAV_API drwav_bool32 drwav_fourcc_equal(const drwav_uint8* a, const char* b)
|
||||
{
|
||||
return drwav__fourcc_equal(a, b);
|
||||
}
|
||||
@@ -5752,6 +5753,9 @@ two different ways to initialize a drwav object.
|
||||
/*
|
||||
REVISION HISTORY
|
||||
================
|
||||
v0.12.3 - 2020-04-30
|
||||
- Fix compilation errors with VC6.
|
||||
|
||||
v0.12.2 - 2020-04-21
|
||||
- Fix a bug where drwav_init_file() does not close the file handle after attempting to load an erroneous file.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user