From c5fc5799fb82f18a26d34ecf4dc6e0aa6700a7d4 Mon Sep 17 00:00:00 2001 From: bnnm Date: Mon, 31 May 2021 22:27:02 +0200 Subject: [PATCH] Fix .wem with fully truncated PCM [Metal Gear Solid V (PC)] --- src/meta/wwise.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/meta/wwise.c b/src/meta/wwise.c index 8127cf20..77df05f3 100644 --- a/src/meta/wwise.c +++ b/src/meta/wwise.c @@ -109,6 +109,10 @@ VGMSTREAM* init_vgmstream_wwise(STREAMFILE* sf) { } vgmstream->num_samples = pcm_bytes_to_samples(ww.data_size, ww.channels, ww.bits_per_sample); + + /* truncated .bnk RIFFs that only have header and no data is possible [Metal Gear Solid V (PC)] */ + if (ww.truncated && !vgmstream->num_samples) + vgmstream->num_samples = 1; /* force something to avoid broken subsongs */ break; case IMA: /* common */