CWaveFile Class Reference

Encapsulates reading or writing sound data to or from a wave file. More...

#include <Sound.h>

List of all members.

Public Member Functions

 CWaveFile ()
 Standard constructor.
 ~CWaveFile ()
 Standard destructor.
HRESULT Open (LPWSTR strFileName)
 Opens a wave file for reading.
HRESULT Close ()
 Close the wave file.
HRESULT Read (BYTE *pBuffer, DWORD dwSizeToRead, DWORD *pdwSizeRead)
 Reads section of data from a wave file into pBuffer and returns how much read in pdwSizeRead, reading not more than dwSizeToRead.
DWORD GetSize ()
 Returns size of file.
HRESULT ResetFile ()
 Resets the internal m_ck pointer so reading starts from the beginning of the file again.

Protected Member Functions

HRESULT ReadMMIO ()
 Support function for reading from a multimedia I/O stream.


Detailed Description

Encapsulates reading or writing sound data to or from a wave file.

This class and its functions are taken from Microsoft DirectX 9.0c SDK (august 2005) Example on using DirectSound buffer.

Author:
Petar Bajic
Date:
January, 16 2007.

Constructor & Destructor Documentation

CWaveFile::CWaveFile (  ) 

Standard constructor.

Author:
Microsoft DirectX Sample Common

CWaveFile::~CWaveFile (  ) 

Standard destructor.

Author:
Microsoft DirectX Sample Common


Member Function Documentation

HRESULT CWaveFile::ReadMMIO (  )  [protected]

Support function for reading from a multimedia I/O stream.

m_hmmio must be valid before calling. This function uses it to update m_ckRiff, and m_pwfx.

Author:
Microsoft DirectX Sample Common

HRESULT CWaveFile::Open ( LPWSTR  strFileName  ) 

Opens a wave file for reading.

Author:
Microsoft DirectX Sample Common

HRESULT CWaveFile::Close (  ) 

Close the wave file.

Author:
Microsoft DirectX Sample Common

HRESULT CWaveFile::Read ( BYTE *  pBuffer,
DWORD  dwSizeToRead,
DWORD *  pdwSizeRead 
)

Reads section of data from a wave file into pBuffer and returns how much read in pdwSizeRead, reading not more than dwSizeToRead.

This uses m_ck to determine where to start reading from. So subsequent calls will be continue where the last left off unless Reset() is called.

Author:
Microsoft DirectX Sample Common

DWORD CWaveFile::GetSize (  ) 

Returns size of file.

Author:
Microsoft DirectX Sample Common

HRESULT CWaveFile::ResetFile (  ) 

Resets the internal m_ck pointer so reading starts from the beginning of the file again.

Author:
Microsoft DirectX Sample Common


The documentation for this class was generated from the following files:
Generated on Wed Mar 26 16:00:54 2008 for Turtle Shepherd by  doxygen 1.5.3