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

#include <cWaveFormat.h>

Inheritance diagram for GrayLib::cWaveFormatEx:
tWAVEFORMATEX

Public Member Functions

void Init () noexcept
 
void Init (WORD wFormatTag2, WORD nChannels2=1, UINT nSamplesPerSec2=8000, WORD wBitsPerSample2=8, WORD wSizeEx2=0) noexcept
 
bool isPCM () const noexcept
 
WORD get_Channels () const noexcept
 
size_t get_BlockSize () const noexcept
 
UINT get_SamplesPerSec () const noexcept
 
size_t get_BytesPerSec () const noexcept
 
size_t get_SampleSize () const
 
UINT get_SampleRangeHalf (void) const
 
size_t GetStructSize (bool bMin) const noexcept
 
void ReCalc (void)
 
bool isValidFormat () const
 

Additional Inherited Members

- Public Attributes inherited from tWAVEFORMATEX
WORD wFormatTag
 format type = WAVE_FORMAT_PCM More...
 
WORD nChannels
 number of channels (i.e. mono, stereo...) (left is always first) More...
 
UINT32 nSamplesPerSec
 sample rate More...
 
UINT32 nAvgBytesPerSec
 for buffer estimation More...
 
WORD nBlockAlign
 block size of data More...
 
WORD wBitsPerSample
 Number of bits per sample of mono data. More...
 
WORD cbSize
 The count in bytes of the size of. More...
 

Detailed Description

Store audio format as a variable sized structure. real size can be same as PCMWAVEFORMAT (which is 2 bytes less)

Member Function Documentation

◆ get_BlockSize()

size_t GrayLib::cWaveFormatEx::get_BlockSize ( ) const
inlinenoexcept

in bytes

◆ get_BytesPerSec()

size_t GrayLib::cWaveFormatEx::get_BytesPerSec ( ) const
inlinenoexcept

◆ get_Channels()

WORD GrayLib::cWaveFormatEx::get_Channels ( ) const
inlinenoexcept

◆ get_SampleRangeHalf()

UINT GrayLib::cWaveFormatEx::get_SampleRangeHalf ( void  ) const
inline

Get half the max dynamic range available

◆ get_SampleSize()

size_t GrayLib::cWaveFormatEx::get_SampleSize ( ) const
inline

In Bytes (only valid for PCM really.)

◆ get_SamplesPerSec()

UINT GrayLib::cWaveFormatEx::get_SamplesPerSec ( ) const
inlinenoexcept

◆ GetStructSize()

size_t GrayLib::cWaveFormatEx::GetStructSize ( bool  bMin) const
inlinenoexcept

Total needed struct size to serialize this. Size needed for WAVEFORMATEX structure + any extra data.

◆ Init() [1/2]

void GrayLib::cWaveFormatEx::Init ( )
inlinenoexcept

◆ Init() [2/2]

void GrayLib::cWaveFormatEx::Init ( WORD  wFormatTag2,
WORD  nChannels2 = 1,
UINT  nSamplesPerSec2 = 8000,
WORD  wBitsPerSample2 = 8,
WORD  wSizeEx2 = 0 
)
inlinenoexcept

WORD wFormatTag = WAVE_FORMAT_PCM

◆ isPCM()

bool GrayLib::cWaveFormatEx::isPCM ( ) const
inlinenoexcept

◆ isValidFormat()

bool GrayLib::cWaveFormatEx::isValidFormat ( ) const

is plausibly playable ?

◆ ReCalc()

void GrayLib::cWaveFormatEx::ReCalc ( void  )

Set derived values properly. Fill in the non user owned fields of the format structure. Only do this if:

  1. the user selects the format from the PCM combo box !
  2. default format from INI file. (could be Compression?)
    Note
    This info may have to be set by the ACM compression driver.

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