VocPlay.h
上传用户:zctools
上传日期:2013-04-03
资源大小:26k
文件大小:1k
源码类别:

多媒体编程

开发平台:

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