paec.h
Go to the documentation of this file.
/*
* paec.h
*
* Open Phone Abstraction Library (OPAL)
* Formally known as the Open H323 project.
*
* Copyright (c) 2004 Post Increment
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Open Phone Abstraction Library.
*
* The author of this code is Damien Sandras
*
* rewritten amd made generic ptlib by Simon Horne
*
* Contributor(s): Miguel Rodriguez Perez
*
* $Revision: 21788 $
* $Author: rjongbloed $
* $Date: 2008-12-11 23:42:13 -0600 (Thu, 11 Dec 2008) $
*/
#ifndef PTLIB_PAEC_H
#define PTLIB_PAEC_H
#ifdef P_USE_PRAGMA
#pragma interface
#endif
#include <ptclib/qchannel.h>
PQUEUE(ReceiveTimeQueue, PTimeInterval);
struct SpeexEchoState;
struct SpeexPreprocessState;
class PAec : public PObject
{
PCLASSINFO(PAec, PObject);
public:
PAec(int _clock = 8000, int _sampletime = 30);
~PAec();
void Send(BYTE * buffer, unsigned & length);
void Receive(BYTE * buffer, unsigned & length);
protected:
PMutex readwritemute;
PQueueChannel *echo_chan;
SpeexEchoState *echoState;
SpeexPreprocessState *preprocessState;
int clockrate; // Frame Rate default 8000hz for narrowband audio
int bufferTime; // Time between receiving and Transmitting
PInt64 minbuffer; // minbuffer (in milliseconds)
PInt64 maxbuffer; // maxbuffer (in milliseconds)
int sampleTime; // Length of each sample
ReceiveTimeQueue rectime; // Queue of timestamps for ensure read/write in sync
PTimeInterval lastTimeStamp; // LastTimeStamp of recieved data
PBoolean receiveReady;
void *ref_buf;
void *echo_buf;
void *e_buf;
void *noise;
};
#endif // PTLIB_PAEC_H
// End Of File ///////////////////////////////////////////////////////////////
PAec::echo_chan
PQueueChannel * echo_chan
Definition: paec.h:78
PAec::receiveReady
PBoolean receiveReady
Definition: paec.h:88
PAec
Definition: paec.h:52
PTimeInterval
This class defines an arbitrary time interval to millisecond accuracy.
Definition: timeint.h:55
PAec::ref_buf
void * ref_buf
Definition: paec.h:89
PAec::e_buf
void * e_buf
Definition: paec.h:91
PAec::bufferTime
int bufferTime
Definition: paec.h:82
PAec::preprocessState
SpeexPreprocessState * preprocessState
Definition: paec.h:80
PAec::PAec
PAec(int _clock=8000, int _sampletime=30)
Create a new canceler.
PAec::Receive
void Receive(BYTE *buffer, unsigned &length)
Playing Channel Should be called after decoding and prior to playing.
PAec::minbuffer
PInt64 minbuffer
Definition: paec.h:83
PBoolean
BOOL PBoolean
Definition: object.h:102
PAec::Send
void Send(BYTE *buffer, unsigned &length)
@name Basic operations
PAec::maxbuffer
PInt64 maxbuffer
Definition: paec.h:84
PAec::sampleTime
int sampleTime
Definition: paec.h:85
PAec::readwritemute
PMutex readwritemute
Definition: paec.h:77
qchannel.h
PAec::rectime
ReceiveTimeQueue rectime
Definition: paec.h:86
PAec::echoState
SpeexEchoState * echoState
Definition: paec.h:79
PAec::~PAec
~PAec()
PAec::clockrate
int clockrate
Definition: paec.h:81
PQueueChannel
Class for implementing a serial queue channel in memory.
Definition: qchannel.h:53
PAec::echo_buf
void * echo_buf
Definition: paec.h:90
PMutex
Synonym for PTimedMutex.
PAec::noise
void * noise
Definition: paec.h:92
PAec::lastTimeStamp
PTimeInterval lastTimeStamp
Definition: paec.h:87
PObject
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
PQUEUE
PQUEUE(ReceiveTimeQueue, PTimeInterval)
This class implements Acoustic Echo Cancellation The principal is to copy to a buffer incoming audio...