#include "snd_main.h"
#include "snd_ogg.h"
+#include "snd_modplug.h"
#define SND_MIN_SPEED 8000
-#define SND_MAX_SPEED 48000
+#define SND_MAX_SPEED 96000
#define SND_MIN_WIDTH 1
#define SND_MAX_WIDTH 2
#define SND_MIN_CHANNELS 1
{ 22050, 2, 2 },
{ 44100, 2, 2 },
{ 48000, 2, 6 },
+ { 96000, 2, 6 },
{ SND_MAX_SPEED, SND_MAX_WIDTH, SND_MAX_CHANNELS },
};
const unsigned int nb_thresholds = sizeof(thresholds) / sizeof(thresholds[0]);
void S_Restart_f(void)
{
+ // NOTE: we can't free all sounds if we are running a map (this frees sfx_t that are still referenced by precaches)
+ // So, refuse to do this if we are connected.
+ if(cls.state == ca_connected)
+ {
+ Con_Printf("snd_restart would wreak havoc if you do that while connected!\n");
+ return;
+ }
+
S_Shutdown();
S_Startup();
}
// COMMANDLINEOPTION: Sound: -nosound disables sound (including CD audio)
if (COM_CheckParm("-nosound"))
+ {
+ // dummy out Play and Play2 because mods stuffcmd that
+ Cmd_AddCommand("play", Host_NoOperation_f, "does nothing because -nosound was specified");
+ Cmd_AddCommand("play2", Host_NoOperation_f, "does nothing because -nosound was specified");
return;
+ }
snd_mempool = Mem_AllocPool("sound", 0, NULL);
memset(channels, 0, MAX_CHANNELS * sizeof(channel_t));
OGG_OpenLibrary ();
+ ModPlug_OpenLibrary ();
}
void S_Terminate (void)
{
S_Shutdown ();
+ ModPlug_CloseLibrary ();
OGG_CloseLibrary ();
// Free all SFXs
{
int i;
+ // NOTE: we can't free all sounds if we are running a map (this frees sfx_t that are still referenced by precaches)
+ // So, refuse to do this if we are connected.
+ if(cls.state == ca_connected)
+ {
+ Con_Printf("snd_unloadallsounds would wreak havoc if you do that while connected!\n");
+ return;
+ }
+
// stop any active sounds
S_StopAllSounds();