订阅所有文章
文章搜索

高级搜索这是社么?这是顶尖最新推出的文章增强型搜索功能!
全网 本站
您现在的位置: 顶尖设计 >> IT学院 >> 编程开发 >> VC >> 文章正文

Windows环境下的麦克风录音系统(6)

作者:slimak  来源:CSDN  点击  更新:2006-12-19 7:06:11  编辑: 画王w  字体

对于录音来说最重要的就是CSoundIn类,下面就是该类的定义:

namespace perdubug {  // prevent the name-space pollution 

class CSoundIn 

{

public:   

                BOOL     __initMic(); // get the best wave format supported by your sound card

                                                    // and then i will use the format to capture sound.

 

                void     __closeMic();

 

               

                BOOL     __openMic(); // open device and begin to capture with the best format(when

                                                       // invoke __initMic function then you will get the best format

                                                       // supported by host's sound card

               

                //

                // if your want to capture sound and export into a wav file please invoke this function

                // to tell me the full path then i will create the wav file.

                //

                void     __createOutputWaveFile(const TCHAR * lpszFileName);

               

                // if you invoke any member function return error/false please

                // use this function to get the result...

                DWORD    __getLastError();

 

                //

                // when the capture buffer is filled please invoke this function to 'add buffer'(Actually

                // you should create two-circular buffers,when 1st buffer is filled then switch to 2st,1st

                // buffer will be wrote into wav file.

                //

                void AddBuffer();

               

                virtual ~CSoundIn();

               

                friend CSoundIn & theSoundCapture();

private:

 

                BOOL  GetBestWaveFormat(WAVEFORMATEX & waveFormatEx);

               

                // because sound card is one and only so i must limit the number of CSoundIn object,

                // but how to limit the class object nums?maybe put constructor into private scope is

                // a good idea,:-)

                CSoundIn();         

 

private:

                WAVEINCAPS                    m_WaveInDevCaps;

                HWAVEIN          

[1] [2] [3] 下一页

  • 上一篇文章:

  • 下一篇文章:
  •      
    热门文章  
    推荐文章  
    相关文章    
     发表评论
      关于我们 | 联系我们 | 站点地图 | 广告投放 | 友情链接 | 在线留言 | 版权申明
    版权所有 © 2004-2007 顶尖设计(bobd.cn)
    未经授权禁止转载,摘编,复制本站内容或建立镜像. 沪ICP备05002835号