1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
7 // static char *VB_Name = "modSound";
14 DirectSoundBuffer ZonkFX[1 + 1];
15 DirectSoundBuffer InfotronFX[1 + 1];
16 DirectSoundBuffer BugFX[1 + 1];
17 DirectSoundBuffer ExplosionFX[1 + 1];
18 DirectSoundBuffer PushFX;
19 DirectSoundBuffer ExitFX;
20 DirectSoundBuffer BaseFX;
27 DSBUFFERDESC bufferDesc;
28 WAVEFORMATEX waveFormat;
32 bufferDesc.lFlags = DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME | DSBCAPS_STATIC;
33 waveFormat.nFormatTag = WAVE_FORMAT_PCM;
34 waveFormat.nChannels = 1;
35 waveFormat.lSamplesPerSec = 8000;
36 waveFormat.nBitsPerSample = 8;
37 waveFormat.nBlockAlign = waveFormat.nBitsPerSample / 8 * waveFormat.nChannels;
38 waveFormat.lAvgBytesPerSec = waveFormat.lSamplesPerSec * waveFormat.nBlockAlign;
39 FName = CAT(App.Path, "/Sound/");
40 for (i = 0; i <= 1; i++)
42 ZonkFX[i] = DSound.CreateSoundBufferFromFile(CAT(FName, "Zonk.wav"), bufferDesc, waveFormat);
43 InfotronFX[i] = DSound.CreateSoundBufferFromFile(CAT(FName, "Infotron.wav"), bufferDesc, waveFormat);
44 BugFX[i] = DSound.CreateSoundBufferFromFile(CAT(FName, "Bug.wav"), bufferDesc, waveFormat);
45 ExplosionFX[i] = DSound.CreateSoundBufferFromFile(CAT(FName, "Explosion.wav"), bufferDesc, waveFormat);
48 BaseFX = DSound.CreateSoundBufferFromFile(CAT(FName, "Base.wav"), bufferDesc, waveFormat);
49 ExitFX = DSound.CreateSoundBufferFromFile(CAT(FName, "Exit.wav"), bufferDesc, waveFormat);
50 PushFX = DSound.CreateSoundBufferFromFile(CAT(FName, "Push.wav"), bufferDesc, waveFormat);
64 for (i = 0; i <= 1; i++)
66 if (! IS_NOTHING(&ZonkFX[i], sizeof(ZonkFX[i])))
68 if (ZonkFX[i].GetStatus() != DSBSTATUS_PLAYING)
70 ZonkFX[i].Play DSBPLAY_DEFAULT;
84 for (i = 0; i <= 1; i++)
86 if (! IS_NOTHING(&BugFX[i], sizeof(BugFX[i])))
88 if (BugFX[i].GetStatus() != DSBSTATUS_PLAYING)
90 BugFX[i].Play DSBPLAY_DEFAULT;
97 void subSoundFXInfotron()
104 for (i = 0; i <= 1; i++)
106 if (! IS_NOTHING(&InfotronFX[i], sizeof(InfotronFX[i])))
108 if (InfotronFX[i].GetStatus() != DSBSTATUS_PLAYING)
110 InfotronFX[i].Play DSBPLAY_DEFAULT;
117 void subSoundFXExplosion()
124 for (i = 0; i <= 1; i++)
126 if (! IS_NOTHING(&ExplosionFX[i], sizeof(ExplosionFX[i])))
128 if (ExplosionFX[i].GetStatus() != DSBSTATUS_PLAYING)
130 ExplosionFX[i].Play DSBPLAY_DEFAULT;
137 void subSoundFXBase()
142 if (IS_NOTHING(&BaseFX, sizeof(BaseFX)))
145 if (BaseFX.GetStatus() != DSBSTATUS_PLAYING)
147 BaseFX.Play DSBPLAY_DEFAULT;
151 void subSoundFXPush()
156 if (IS_NOTHING(&PushFX, sizeof(PushFX)))
159 if (PushFX.GetStatus() != DSBSTATUS_PLAYING)
161 PushFX.Play DSBPLAY_DEFAULT;
165 void subSoundFXExit()
170 if (IS_NOTHING(&ExitFX, sizeof(ExitFX)))
173 if (ExitFX.GetStatus() != DSBSTATUS_PLAYING)
175 ExitFX.Play DSBPLAY_DEFAULT;