+// 0 to NUM_AMBIENTS - 1 = water, etc
+// NUM_AMBIENTS to NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS - 1 = normal entity sounds
+// NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS to total_channels = static sounds
+#define MAX_DYNAMIC_CHANNELS 512
+#define MAX_CHANNELS 1028
+
+extern unsigned int total_channels;
+extern channel_t channels[MAX_CHANNELS];
+
+extern snd_ringbuffer_t *snd_renderbuffer;
+extern unsigned int soundtime; // WARNING: sound modules must NOT use it
+
+extern cvar_t _snd_mixahead;
+extern cvar_t snd_swapstereo;
+extern cvar_t snd_streaming;
+
+#define SND_CHANNELLAYOUT_AUTO 0
+#define SND_CHANNELLAYOUT_STANDARD 1
+#define SND_CHANNELLAYOUT_ALSA 2
+extern cvar_t snd_channellayout;
+
+extern int snd_blocked; // counter. When > 0, we stop submitting sound to the audio device