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

📄 oggrateconvert.h

📁 OggPlay for Symbian 是symbian上的一个媒体播放程序的源码。它支持ogg,wav等等多媒体格式。
💻 H
字号:
#ifndef OGGRATECONVERT_H
#define OGGRATECONVERT_H

const TInt KFreqArrayLength = 100; // Length of the memory of the previous freqs bin
const TInt KNumberOfFreqBins = 16; // This shouldn't be changed without making same changes to vorbis library!

class MOggSampleRateFillBuffer 
{
public:
   virtual TInt GetNewSamples(TDes8 &aBuffer, TBool aRequestFrequencyBins) = 0;
};


typedef enum {
    EMinus24dB,
    EMinus18dB,
    EMinus12dB,
    ENoGain,
    EStatic6dB,  // A static gain of 6dB, with saturation
    EStatic12dB   // A static gain of 12 dB, with saturation
} TGainType;


class COggSampleRateConverter: public CBase
{
public:
	COggSampleRateConverter();
    ~COggSampleRateConverter();

    void Init(MOggSampleRateFillBuffer * aSampleRateFillBufferProvider,
        TInt aBufferSize,
        TInt aMinimumSamplesInBuffer,
        TInt aInputSampleRate,
        TInt aOutputSampleRate,
        TInt aInputChannel,
        TInt aOutputChannel);
        
    TInt FillBuffer( TDes8 &aBuffer);
    void SetVolumeGain(TGainType aGain);
private:
    void MixChannels( TDes8 &aInputBuffer, TDes8 &aOutputBuffer );
    void ConvertRateMono( TDes8 &aInputBuffer, TDes8 &aOutputBuffer );
    void ConvertRateStereo( TDes8 &aInputBuffer, TDes8 &aOutputBuffer );
    void ApplyGain( TDes8 &aInputBuffer, TInt shiftValue );
    void ApplyNegativeGain( TDes8 &aInputBuffer, TInt shiftValue );
    TInt  iMinimumSamplesInBuffer;
    TBool iRateConvertionNeeded;
    TBool iChannelMixingNeeded;

    // Variables for rate convertion
    TUint32 iDtb;
    TUint32 iTime;
    TBool   iValidX1;
    TInt16  ix1;
    TInt16  ix2;
    TGainType iGain;

    HBufC8 *iIntermediateBuffer;
    MOggSampleRateFillBuffer * iFillBufferProvider;
    TReal  iSamplingRateFactor;

	void (COggSampleRateConverter::*iConvertRateFn)(TDes8& aInputBuffer, TDes8& aOutputBuffer);
};

#endif

⌨️ 快捷键说明

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