+#ifndef _WAVEFORMATEXTENSIBLE_
+#define _WAVEFORMATEXTENSIBLE_
+typedef struct
+{
+ WAVEFORMATEX Format;
+ union
+ {
+ WORD wValidBitsPerSample; // bits of precision
+ WORD wSamplesPerBlock; // valid if wBitsPerSample==0
+ WORD wReserved; // If neither applies, set to zero
+ } Samples;
+ DWORD dwChannelMask; // which channels are present in stream
+ GUID SubFormat;
+} WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;
+#endif
+
+#if !defined(WAVE_FORMAT_EXTENSIBLE)
+# define WAVE_FORMAT_EXTENSIBLE 0xFFFE
+#endif
+
+// Some speaker positions
+#ifndef SPEAKER_FRONT_LEFT
+# define SPEAKER_FRONT_LEFT 0x1
+# define SPEAKER_FRONT_RIGHT 0x2
+# define SPEAKER_FRONT_CENTER 0x4
+# define SPEAKER_LOW_FREQUENCY 0x8
+# define SPEAKER_BACK_LEFT 0x10
+# define SPEAKER_BACK_RIGHT 0x20
+# define SPEAKER_FRONT_LEFT_OF_CENTER 0x40
+# define SPEAKER_FRONT_RIGHT_OF_CENTER 0x80
+// ... we never use the other values
+#endif
+
+// KSDATAFORMAT_SUBTYPE_PCM = GUID "00000001-0000-0010-8000-00aa00389b71"
+static const GUID MY_KSDATAFORMAT_SUBTYPE_PCM =
+{
+ 0x00000001,
+ 0x0000,
+ 0x0010,
+ {
+ 0x80, 0x00,
+ 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71
+ }
+};
+
+
+// ==============================================================================
+
+extern HWND mainwindow;
+static cvar_t snd_wav_partitionsize = {CVAR_SAVE, "snd_wav_partitionsize", "1024", "controls sound delay in samples, values too low will cause crackling, too high will cause delayed sounds"};
+static qboolean sndsys_registeredcvars = false;
+
+#ifdef SUPPORTDIRECTX