#include <Sound.h>
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. |
This class and its functions are taken from Microsoft DirectX 9.0c SDK (august 2005) Example on using DirectSound buffer.
CWaveFile::CWaveFile | ( | ) |
Standard constructor.
CWaveFile::~CWaveFile | ( | ) |
Standard destructor.
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.
HRESULT CWaveFile::Open | ( | LPWSTR | strFileName | ) |
Opens a wave file for reading.
HRESULT CWaveFile::Close | ( | ) |
Close the wave file.
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.
DWORD CWaveFile::GetSize | ( | ) |
Returns size of file.
HRESULT CWaveFile::ResetFile | ( | ) |
Resets the internal m_ck pointer so reading starts from the beginning of the file again.