shithub: ft²

Download patch

ref: 7398c6dfa438f2cdf786491c32283660972a2401
parent: 976362f41e576978e9f17d38759acb2f11b96360
author: Olav Sørensen <olav.sorensen@live.no>
date: Fri Nov 21 17:47:05 EST 2025

Support loading WAVE_FORMAT_EXTENSIBLE .WAVs

--- a/src/smploaders/ft2_load_wav.c
+++ b/src/smploaders/ft2_load_wav.c
@@ -17,7 +17,8 @@
 enum
 {
 	WAV_FORMAT_PCM = 1,
-	WAV_FORMAT_IEEE_FLOAT = 3
+	WAV_FORMAT_IEEE_FLOAT = 3,
+	WAV_FORMAT_EXTENSIBLE = 65534
 };
 
 static bool wavIsStereo(FILE *f);
@@ -140,7 +141,14 @@
 	fread(&sampleRate,  4, 1, f);
 	fseek(f, 6, SEEK_CUR); // unneeded
 	fread(&bitsPerSample, 2, 1, f);
+
 	sampleLength = dataLen;
+
+	if (audioFormat == WAV_FORMAT_EXTENSIBLE)
+	{
+		fseek(f, 8, SEEK_CUR);
+		fread(&audioFormat, 2, 1, f);
+	}
 	// ---------------------------
 
 	// test if the WAV is compatible with our loader
--