diff options
| author | Ray <[email protected]> | 2022-06-17 21:24:59 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2022-06-17 21:24:59 +0200 |
| commit | 8d9c45a08a85ca8f81e10c2ff1d685faee9610d5 (patch) | |
| tree | 1081100f5d2c88705d16f363ead1988aeea863be /src/raudio.c | |
| parent | d4f60f8303139c126cb00644851d8126c1e382dc (diff) | |
| download | raylib-8d9c45a08a85ca8f81e10c2ff1d685faee9610d5.tar.gz raylib-8d9c45a08a85ca8f81e10c2ff1d685faee9610d5.zip | |
tweak
Diffstat (limited to 'src/raudio.c')
| -rw-r--r-- | src/raudio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/raudio.c b/src/raudio.c index 369fb852..5515b765 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1152,8 +1152,8 @@ void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) ma_format formatOut = ((sampleSize == 8)? ma_format_u8 : ((sampleSize == 16)? ma_format_s16 : ma_format_f32)); ma_uint32 frameCountIn = wave->frameCount; - ma_uint32 frameCount = (ma_uint32)ma_convert_frames(NULL, 0, formatOut, channels, sampleRate, NULL, frameCountIn, formatIn, wave->channels, wave->sampleRate); + if (frameCount == 0) { TRACELOG(LOG_WARNING, "WAVE: Failed to get frame count for format conversion"); @@ -1173,6 +1173,7 @@ void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) wave->sampleSize = sampleSize; wave->sampleRate = sampleRate; wave->channels = channels; + RL_FREE(wave->data); wave->data = data; } |
