www.pudn.com > mediator15src.zip > AudioCompressor.h, change:2002-07-15,size:2303b


/* 
 * AudioCompressor.h 
 * Copyright (C) 2002 Arno Hornberger  
 * Original Version Copyright (C) Alberto Vigata - January 2000 - ultraflask@yahoo.com 
 * Class 'AudioL3Corrector' Copyright (C) 1998-2001 Avery Lee 
 * 
 * This file is part of MPEG Mediator, a free MPEG stream converter. 
 * 
 * MPEG Mediator is free software; you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License as published by 
 * the Free Software Foundation; either version 2 of the License, or 
 * (at your option) any later version. 
 * 
 * MPEG Mediator is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 * GNU General Public License for more details. 
 * 
 * You should have received a copy of the GNU General Public License 
 * along with this program; if not, write to the Free Software 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
 */ 
 
#if !defined(AFX_AUDIOCOMPRESSOR_H__10D13B53_9E4C_4EEC_8FDB_75E18F87AB0B__INCLUDED_) 
#define AFX_AUDIOCOMPRESSOR_H__10D13B53_9E4C_4EEC_8FDB_75E18F87AB0B__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
#define AUDIO_BUFFER_SIZE 0x7FFFF 
#define MIN_AUDIO_BUFFER  0x3FFF 
 
class AudioL3Corrector 
{ 
	private: 
		long samples, frame_bytes, read_left; 
		bool header_mode; 
		char hdr_buffer[4]; 
 
	public: 
		AudioL3Corrector(); 
		long ComputeByterate(long sample_rate); 
		void Process(void *buffer, long bytes); 
}; 
 
class CAudioCompressor   
{ 
	public: 
//		bool InitAudioCompressor(HACMDRIVERID hadid, WAVEFORMATEX *wfxIn, WAVEFORMATEX *wfxOut, bool hq); 
//		bool DeInitAudioCompressor(); 
		bool Compress(PBYTE inAudio, long inSize, PBYTE &outAudio, long &outSize); 
   
		CAudioCompressor(HACMDRIVERID hadid, WAVEFORMATEX *wfxIn, WAVEFORMATEX *wfxOut, bool hq); 
		~CAudioCompressor();  
   
  private: 
    PBYTE pInAudio, pOutAudio; 
    ACMSTREAMHEADER m_sStreamHdr; 
		HACMDRIVER m_hHad; // Handle to opened driver 
    HACMSTREAM m_hHas; // Handle to opened stream conversion  
    long m_nBufferPtr; 
}; 
 
#endif // !defined(AFX_AUDIOCOMPRESSOR_H__10D13B53_9E4C_4EEC_8FDB_75E18F87AB0B__INCLUDED_)