From e59a41be6994ae0b9dca6e82b688a74d21e87638 Mon Sep 17 00:00:00 2001 From: Luciano Iam Date: Fri, 30 Sep 2022 14:11:42 +0200 Subject: [PATCH] Properly load float WavPack audio --- external/st_audiofile/src/st_audiofile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/external/st_audiofile/src/st_audiofile.c b/external/st_audiofile/src/st_audiofile.c index 85e0542a..452a1bee 100644 --- a/external/st_audiofile/src/st_audiofile.c +++ b/external/st_audiofile/src/st_audiofile.c @@ -545,7 +545,9 @@ uint64_t st_read_f32(st_audio_file* af, float* buffer, uint64_t count) count = drmp3_read_pcm_frames_f32(af->mp3, count, buffer); break; case st_audio_file_wv: - { + if (af->cache.wv.mode & MODE_FLOAT) { + count = WavpackUnpackSamples(af->wv, (int32_t*)buffer, (uint32_t)count); + } else { uint32_t channels = af->cache.wv.channels; int32_t* buf_i32 = (int32_t*)malloc(4 * channels * count); if (!buf_i32) {