Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cSoundBase Struct Reference

wrap WAVEFORMATEX More...

#include <cSoundBase.h>

Inheritance diagram for GrayLib::cSoundBase:
GrayLib::cSoundMixer

Static Public Member Functions

static LONG GRAYCALL FToDecibelI (float v)
 
static float GRAYCALL DecibelItoF (LONG d)
 
static float GRAYCALL VolToF (SOUND_VOL_t v) noexcept
 
static SOUND_VOL_t GRAYCALL FToVol (float v) noexcept
 
static LONG GRAYCALL VolToDecibelI (SOUND_VOL_t v)
 
static SOUND_VOL_t GRAYCALL DecibelItoVol (LONG d)
 

Static Public Attributes

static const SOUND_VOL_t k_VOL_MIN = 0
 silent More...
 
static const SOUND_VOL_t k_VOL_MAX = 0xFFFF
 mono linear max perceived volume from waveOutGetVolume() M$ docs. NOT decibels which is logarithmic with perception. More...
 

Detailed Description

wrap WAVEFORMATEX

Generic sound functions. decibel to linear convert for DirectSound and DirectShow.

Member Function Documentation

◆ DecibelItoF()

float GRAYCALL GrayLib::cSoundBase::DecibelItoF ( LONG  d)
static

Convert hundredths of a decibel to linear SOUND volume level. decibel to linear convert for DirectSound and DirectShow.

  • d = decibels (DSBVOLUME_MIN(-10000) to DSBVOLUME_MAX(0))
    Returns
    0.0 to 1.0 (linear scale perception scale as is SOUND_VOL_t)

◆ DecibelItoVol()

static SOUND_VOL_t GRAYCALL GrayLib::cSoundBase::DecibelItoVol ( LONG  d)
inlinestatic

◆ FToDecibelI()

LONG GRAYCALL GrayLib::cSoundBase::FToDecibelI ( float  v)
static

decibel to linear convert for DirectSound and DirectShow. Create the value consumed by D3D SetVolume

  • v = 0 to 1 volume (linear scale perception scale as is SOUND_VOL_t)
    Returns
    Attenuation, in hundredths of a decibel (dB). (logarithmic to perception) (DSBVOLUME_MIN to DSBVOLUME_MAX)

◆ FToVol()

static SOUND_VOL_t GRAYCALL GrayLib::cSoundBase::FToVol ( float  v)
inlinestaticnoexcept

Convert float (0-1) to SOUND_VOL_t. mono linear perceived volume

Returns
k_VOL_MIN to k_VOL_MAX

◆ VolToDecibelI()

static LONG GRAYCALL GrayLib::cSoundBase::VolToDecibelI ( SOUND_VOL_t  v)
inlinestatic

◆ VolToF()

static float GRAYCALL GrayLib::cSoundBase::VolToF ( SOUND_VOL_t  v)
inlinestaticnoexcept

Convert SOUND_VOL_t to a float (0-1). mono linear perceived volume

Returns
0.0f to 1.0f

Member Data Documentation

◆ k_VOL_MAX

const SOUND_VOL_t GrayLib::cSoundBase::k_VOL_MAX = 0xFFFF
static

mono linear max perceived volume from waveOutGetVolume() M$ docs. NOT decibels which is logarithmic with perception.

◆ k_VOL_MIN

const SOUND_VOL_t GrayLib::cSoundBase::k_VOL_MIN = 0
static

silent


The documentation for this struct was generated from the following files: