From 662c13b943cf19ebba601e76c0f80e1b8cfffae5 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Sun, 9 Apr 2023 21:47:12 +0700 Subject: [PATCH] load ADPCM formats as 16-bit for now --- src/i_sndfile.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/i_sndfile.c b/src/i_sndfile.c index bceed90f..bf45b9af 100644 --- a/src/i_sndfile.c +++ b/src/i_sndfile.c @@ -468,6 +468,16 @@ static boolean OpenFile(sndfile_t *file, void *data, sf_count_t size) if (alIsExtensionPresent("AL_EXT_FLOAT32")) sample_format = Float; break; + + case SF_FORMAT_IMA_ADPCM: + case SF_FORMAT_MS_ADPCM: + // ADPCM formats require setting a block alignment as specified in + // the file, which needs to be read from the wave 'fmt ' chunk + // manually since libsndfile doesn't provide it in a + // format-agnostic way. For now load it as 16-bit and have + // libsndfile do the conversion. + sample_format = Int16; + break; } frame_size = 1;