VocPlay.h
Upload User: zctools
Upload Date: 2013-04-03
Package Size: 26k
Code Size: 1k
Development Platform:

Visual C++

  1. #ifndef _VOCPLAYER_H
  2. #define _VOCPLAYER_H
  3. #include <mmsystem.h>
  4. typedef struct
  5. {
  6.    UCHAR       ucBitsPerSample;
  7.    UCHAR       ucChannels;
  8.    USHORT      usFileFormat;
  9.    USHORT      usTimeConstant;
  10.    long        lSamplesPerSeconds;
  11.    long        lTotalLength;
  12. } FILEINFO;
  13. class CVocPlayer
  14. {
  15.    public:
  16.       CVocPlayer();
  17.       virtual ~CVocPlayer();
  18.       void        Play( const CString &rcFileName, CWnd *pCallbackWnd );
  19.       inline void Reset() const        { waveOutReset( hWaveOut ); }
  20.       void        Clear();
  21.    protected:
  22.       char        *pData;
  23.       bool        boPlaying;
  24.       HWAVEOUT    hWaveOut;
  25.       WAVEHDR     sWaveHdr;
  26.    protected:
  27.       void        Decode( const CString &rcFileName, FILEINFO *psFileInfo );
  28. };
  29. #endif               // #ifndef _VOCPLAYER_H