From 71ae5943c97066e7f22a5d76c49929da48ef01bf Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Mon, 10 Aug 2020 00:01:21 +0200 Subject: [PATCH] Extract the table size off U-he metadata --- src/sfizz/FileMetadata.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sfizz/FileMetadata.cpp b/src/sfizz/FileMetadata.cpp index 87379796..a03069c8 100644 --- a/src/sfizz/FileMetadata.cpp +++ b/src/sfizz/FileMetadata.cpp @@ -377,9 +377,16 @@ bool FileMetadataReader::Impl::extractUheWavetable(WavetableInfo &wt) if (!uhwt) return false; - // u-he Hive: no idea what is inside this one, 2048 assumed + // zeros (chunk version?), 4 bytes LE + // number of tables, 4 bytes LE + // table size, 4 bytes LE + + uint8_t data[12]; + if (readRiffData(uhwt->index, data, sizeof(data)) != sizeof(data)) + return false; + + wt.tableSize = u32le(data + 8); - wt.tableSize = 2048; wt.crossTableInterpolation = 0; wt.oneShot = false;