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

📄 wavaudiofilesource.h

📁 rtsp协议的主要实现代码.对开发流媒体
💻 H
字号:
// WAVAudioFileSource.h: interface for the CWAVAudioFileSource class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_WAVAUDIOFILESOURCE_H__8EE2AB46_6388_48FA_BB10_0128ED2F8D8C__INCLUDED_)
#define AFX_WAVAUDIOFILESOURCE_H__8EE2AB46_6388_48FA_BB10_0128ED2F8D8C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "stdio.h"

#include "FramedSource.h"


class WAVAudioFileSource  : public FramedSource
{
public:
	static WAVAudioFileSource* createNew(char const* fileName,BOOL ConvertToULaw = FALSE);
	WAVAudioFileSource(FILE* fid,BOOL ConvertToULaw = FALSE);
	virtual ~WAVAudioFileSource();
	virtual void doGetNextFrame();

	unsigned numPCMBytes() const;
	void setScaleFactor(int scale);
	void seekToPCMByte(unsigned byteNumber);
	virtual unsigned char GetPayloadFormatCode();
	unsigned samplingFrequency() 
	{
		return fSamplingFrequency;
	}
	unsigned char numChannels()
	{
		return fNumChannels;
	}
	unsigned char bitsPerSample() const { return fBitsPerSample;}

private:
	void EndianSwap16();
private:
	FILE* fFid;
	double fPlayTimePerSample; // useconds
	unsigned fPreferredFrameSize;
	unsigned fLastPlayTime; // useconds
	unsigned fWAVHeaderSize;
	unsigned fFileSize;
	int fScaleFactor;	
	unsigned char fBitsPerSample, fNumChannels;
	unsigned fSamplingFrequency;
	unsigned fGranularityInMS;
	BOOL fConvertToULaw;
};

#endif // !defined(AFX_WAVAUDIOFILESOURCE_H__8EE2AB46_6388_48FA_BB10_0128ED2F8D8C__INCLUDED_)

⌨️ 快捷键说明

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