⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dsound_buf.h

📁 这是在PCA下的基于IPP库示例代码例子,在网上下了IPP的库之后,设置相关参数就可以编译该代码.
💻 H
字号:
/*//////////////////////////////////////////////////////////////////////////////////                  INTEL CORPORATION PROPRIETARY INFORMATION//     This software is supplied under the terms of a license agreement or//     nondisclosure agreement with Intel Corporation and may not be copied//     or disclosed except in accordance with the terms of that agreement.//          Copyright(c) 2003-2005 Intel Corporation. All Rights Reserved.//*/#ifdef UMC_ENABLE_DSOUND_AUDIO_RENDER#ifndef __DIRECT_SOUND_BUFFER_H__#define __DIRECT_SOUND_BUFFER_H__#include <dplay.h>#include <dsound.h>#include "umc_structures.h"#include "umc_mutex.h"namespace UMC{    class DSBuffer    {    public:        DSBuffer():            m_pDS(NULL),            m_pDSBSecondary(NULL),            m_pDSBPrimary(NULL),            m_dwDSBufferSize(0),            m_dwNextWriteOffset(0),            m_dfNorm(1),            m_dfCompensation(0.005),            m_hWnd(NULL),            m_bPausedWaitingData(false)        {}        virtual ~DSBuffer(){    Close();    }        Status          Init(const HWND hWnd,                            const DWORD dwBufferSize,                            const WORD wChannels,                            const DWORD dwFrequency,                            const WORD wBytesPerSample);        Status          CopyDataToBuffer(unsigned char* pucData,                                    DWORD dwLength,                                    DWORD& rdwBytesWrote);        Status          GetPlayPos(DWORD& rdwPos);        Status          GetWritePos(DWORD& rdwPos);        Status          Pause(bool bPause);        float           SetVolume(float fVolume);        float           GetVolume();        Status          Reset();        void            Close();        virtual Status  DynamicSetParams(const WORD wChannels,                            const DWORD dwFrequency,                            const WORD wBytesPerSample);        inline DWORD    GetNextWriteOffset()         {    return m_dwNextWriteOffset;    }        inline float    GetCompensation()        {    return (float) m_dfCompensation;    }    protected:        LPDIRECTSOUND8       m_pDS;        LPDIRECTSOUNDBUFFER  m_pDSBSecondary;        LPDIRECTSOUNDBUFFER  m_pDSBPrimary;        DWORD                m_dwDSBufferSize;        DWORD                m_dwNextWriteOffset;        double               m_dfNorm;        double               m_dfCompensation;        HWND                 m_hWnd;        bool                 m_bPausedWaitingData;        UMC::Mutex           m_MutAccess;        DWORD               m_dwInitedBufferSize;        WORD                m_wInitedChannels;        DWORD               m_dwInitedFrequency;        WORD                m_wInitedBytesPerSample;    };}  //  namespace UMC#endif    //     __DIRECT_SOUND_BUFFER_H__#endif //#ifdef UMC_ENABLE_DSOUND_AUDIO_RENDER

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -