void SNDDXSetVolume(int volume) { if (!lpDSB2) return ; /* might happen when changing sounddevice on the fly, caused a gpf */ soundvolume = (((LONG)volume) - 100) * 100; if (!issoundmuted) IDirectSoundBuffer8_SetVolume (lpDSB2, soundvolume); }
void Px_SetPCMOutputVolume( PxMixer *mixer, PxVolume volume ) { PxInfo *info = (PxInfo *)mixer; /* convert volume (range 0.0 - 1.0) to hundredths of a dB */ long dB = ((log(volume) / log(10.0) * 20.0)) * 100; IDirectSoundBuffer8_SetVolume(info->output, dB); }
void SNDDXUnMuteAudio() { issoundmuted = 0; IDirectSoundBuffer8_SetVolume (lpDSB2, soundvolume); }
void SNDDXMuteAudio() { issoundmuted = 1; IDirectSoundBuffer8_SetVolume (lpDSB2, DSBVOLUME_MIN); }