6 #ifndef _INC_cSoundBase_H
7 #define _INC_cSoundBase_H
12 #include "../GrayLibBase.h"
24 #define _GTNSND(_x) _x
38 virtual size_t get_WaveDataLength() = 0;
39 virtual const void* get_WaveData() = 0;
51 static LONG
GRAYCALL FToDecibelI(
float v);
52 static float GRAYCALL DecibelItoF(LONG d);
58 return ((
float)(v - k_VOL_MIN)) / (k_VOL_MAX - k_VOL_MIN);
64 return k_VOL_MIN + (
SOUND_VOL_t)((k_VOL_MAX - k_VOL_MIN) * v);
69 return FToDecibelI(VolToF(v));
73 return FToVol(DecibelItoF(d));
77 static inline HRESULT GetHResultFrom(MMRESULT mmRes) noexcept
80 if (mmRes == MMSYSERR_NOERROR)
#define IGNORE_WARN_INTERFACE(c)
Definition: GrayCore.h:79
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
static HRESULT Make(FACILITY_TYPE eFacility, WORD wCode) noexcept
Definition: HResult.h:186
Definition: IUnknown.h:68
WORD SOUND_VOL_t
Mono Attenuation of the audio. linear perception 0 to k_VOL_MAX(0xffff). NOT decibels.
Definition: cSoundBase.h:29
DWORD SOUND_VOL2_t
Stereo linear perceived volume. LOWORD(left) HIWORD(right)
Definition: cSoundBase.h:30
MIDL_INTERFACE("0C3E2E71-B93C-11d2-AAD0-006007654304") IScriptableObj
@ FACILITY_MMSYS
Facility for _WIN32 MMSYSTEM MMRESULT error codes. MMSYSERR_BASE.
Definition: HResult.h:57
wrap WAVEFORMATEX
Definition: cSoundBase.h:44
static float GRAYCALL VolToF(SOUND_VOL_t v) noexcept
Definition: cSoundBase.h:54
static SOUND_VOL_t GRAYCALL FToVol(float v) noexcept
Definition: cSoundBase.h:60
static LONG GRAYCALL VolToDecibelI(SOUND_VOL_t v)
Definition: cSoundBase.h:67
static SOUND_VOL_t GRAYCALL DecibelItoVol(LONG d)
Definition: cSoundBase.h:71