Commit e976366c authored by Tristan Matthews's avatar Tristan Matthews

* #7842: fixed Weffc++ warnings/uninitialized variables

parent ce437dc3
......@@ -178,7 +178,7 @@ DBUS_CPP_REQUIRED_VERSION=0.6.0-pre1
PKG_CHECK_MODULES(DBUSCPP, dbus-c++-1,,
AC_MSG_ERROR([You need the DBus-c++ libraries (version $DBUS_CPP_REQUIRED_VERSION or better)]))
CXXFLAGS="${CXXFLAGS} -g -Wno-return-type -Wall -Wextra -Wnon-virtual-dtor -Wfatal-errors"
CXXFLAGS="${CXXFLAGS} -g -Wno-return-type -Wall -Wextra -Wnon-virtual-dtor -Weffc++ -Wfatal-errors"
AC_CHECK_LIB([expat], XML_ParserCreate_MM,
[AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false)],
......
......@@ -35,16 +35,20 @@
Account::Account(const std::string& accountID, const std::string &type) :
accountID_(accountID)
, username_()
, hostname_()
, alias_()
, link_(NULL)
, enabled_(true)
, type_(type)
, registrationState_(Unregistered)
, codecOrder_()
, codecStr_("")
, codecStr_()
, ringtonePath_("/usr/share/sflphone/ringtones/konga.ul")
, ringtoneEnabled_(true)
, displayName_("")
, userAgent_("SFLphone")
, mailBox_()
{
// Initialize the codec order, used when creating a new account
loadDefaultCodecs();
......
......@@ -39,6 +39,7 @@ AudioLayer::AudioLayer()
, urgentRingBuffer_(SIZEBUF, Call::DEFAULT_ID)
, audioSampleRate_(Manager::instance().getMainBuffer()->getInternalSamplingRate())
, mutex_()
, dcblocker_()
, audioPref(Manager::instance().audioPreference)
, converter_(new SamplerateConverter(audioSampleRate_))
, lastNotificationTime_(0)
......
......@@ -133,11 +133,8 @@ class AudioLayer {
* Lock for the entire audio layer
*/
ost::Mutex mutex_;
DcBlocker dcblocker_;
AudioPreference &audioPref;
SamplerateConverter *converter_;
private:
......
......@@ -52,6 +52,7 @@ struct wavhdr {
AudioRecord::AudioRecord() : fileHandle_(NULL)
, fileType_(FILE_INVALID)
, channels_(1)
, byteCounter_(0)
, sndSmplRate_(8000)
......@@ -62,6 +63,7 @@ AudioRecord::AudioRecord() : fileHandle_(NULL)
, mixBuffer_(new SFLDataFormat[nbSamplesMax_])
, micBuffer_(new SFLDataFormat[nbSamplesMax_])
, spkBuffer_(new SFLDataFormat[nbSamplesMax_])
, savePath_()
{
createFilename();
}
......
......@@ -35,11 +35,12 @@
#include <cstdlib>
#include "global.h"
#include "noncopyable.h"
class AudioRecord {
public:
enum FILE_TYPE { FILE_RAW, FILE_WAV };
enum FILE_TYPE { FILE_RAW, FILE_WAV, FILE_INVALID };
AudioRecord();
......@@ -237,6 +238,8 @@ class AudioRecord {
*/
std::string savePath_;
private:
NON_COPYABLE(AudioRecord);
};
#endif // _AUDIO_RECORD_H
......@@ -34,7 +34,8 @@
int AudioRecorder::count_ = 0;
AudioRecorder::AudioRecorder(AudioRecord *arec, MainBuffer *mb) : Thread(), mbuffer_(mb), arecord_(arec)
AudioRecorder::AudioRecorder(AudioRecord *arec, MainBuffer *mb) : Thread(),
recorderId_(), mbuffer_(mb), arecord_(arec)
{
assert(mb);
setCancel(cancelDeferred);
......
......@@ -42,7 +42,10 @@
namespace sfl {
AudioRtpFactory::AudioRtpFactory(SIPCall *ca) : rtpSession_(NULL), remoteContext_(NULL), localContext_(NULL), ca_(ca)
AudioRtpFactory::AudioRtpFactory(SIPCall *ca) : rtpSession_(NULL),
audioRtpThreadMutex_(), srtpEnabled_(false),
keyExchangeProtocol_(Symmetric), helloHashEnabled_(false),
remoteContext_(NULL), localContext_(NULL), ca_(ca)
{}
AudioRtpFactory::~AudioRtpFactory()
......
......@@ -35,6 +35,7 @@
#include <cc++/thread.h>
#include <ccrtp/CryptoContext.h>
#include "audio_rtp_session.h"
#include "noncopyable.h"
#include "sip/sdes_negotiator.h"
......@@ -138,6 +139,7 @@ class AudioRtpFactory {
void sendDtmfDigit(int digit);
private:
NON_COPYABLE(AudioRtpFactory);
AudioRtpSession *rtpSession_;
ost::Mutex audioRtpThreadMutex_;
......
......@@ -47,8 +47,10 @@ AudioRtpRecord::AudioRtpRecord() :
, codecSampleRate_(0)
, codecFrameSize_(0)
, converterSamplingRate_(0)
, dtmfQueue_()
, micAmplFactor_(initFadeinFactor)
, noiseSuppress_(0)
, audioProcessMutex_()
, callId_("")
, dtmfPayloadType_(101) // same as Asterisk
{
......
......@@ -169,18 +169,14 @@ class AudioRtpRecordHandler {
void putDtmfEvent(int digit);
protected:
AudioRtpRecord audioRtpRecord_;
private:
const std::string id_;
EchoSuppress echoCanceller;
GainControl gainController;
};
}
#endif // AUDIO_RTP_RECORD_HANDLER_H__
......@@ -47,6 +47,8 @@ AudioRtpSession::AudioRtpSession(SIPCall * sipcall, RtpMethod type, ost::RTPData
AudioRtpRecordHandler(sipcall)
, ca_(sipcall)
, type_(type)
, remote_ip_()
, remote_port_(0)
, timestamp_(0)
, timestampIncrement_(0)
, timestampCount_(0)
......
......@@ -38,6 +38,7 @@
#include <audio/codecs/audiocodec.h>
#include <ccrtp/rtp.h>
#include <ccrtp/formats.h>
#include "noncopyable.h"
class SIPCall;
......@@ -96,6 +97,7 @@ class AudioRtpSession : public AudioRtpRecordHandler {
RtpMethod type_;
private:
NON_COPYABLE(AudioRtpSession);
/**
* Set the audio codec for this RTP session
......
......@@ -33,6 +33,7 @@
#include "audio_rtp_session.h"
#include "audio_symmetric_rtp_session.h"
#include "sip/sdes_negotiator.h"
#include "noncopyable.h"
#include <ccrtp/CryptoContext.h>
#include <vector>
......@@ -109,6 +110,7 @@ class AudioSrtpSession : public AudioSymmetricRtpSession {
ost::CryptoContext* localCryptoCtx_;
private:
NON_COPYABLE(AudioSrtpSession);
/**
* Init local master key according to current crypto context
......
......@@ -44,6 +44,7 @@ namespace sfl {
AudioSymmetricRtpSession::AudioSymmetricRtpSession(SIPCall * sipcall) :
ost::SymmetricRTPSession(ost::InetHostAddress(sipcall->getLocalIp().c_str()), sipcall->getLocalAudioPort())
, AudioRtpSession(sipcall, Symmetric, this, this)
, echoCanceller()
, rtpThread_(new AudioRtpThread(this))
{
INFO("AudioSymmetricRtpSession: Setting new RTP session with destination %s:%d", ca_->getLocalIp().c_str(), ca_->getLocalAudioPort());
......
......@@ -42,6 +42,7 @@
#include "noncopyable.h"
using std::ptrdiff_t;
#include <ccrtp/rtp.h>
#include <ccrtp/iqueue.h>
#include <cc++/numbers.h> // ost::Time
......@@ -70,6 +71,7 @@ class AudioSymmetricRtpSession : public ost::TimerPort, public ost::SymmetricRTP
}
private:
NON_COPYABLE(AudioSymmetricRtpSession);
class AudioRtpThread : public ost::Thread, public ost::TimerPort {
public:
......
......@@ -28,7 +28,6 @@
* as that of the covered work.
*/
#include "zrtp_session_callback.h"
#include "global.h"
#include "sip/sipcall.h"
#include "dbus/dbusmanager.h"
......
......@@ -39,6 +39,7 @@ using std::ptrdiff_t;
#include <libzrtpcpp/ZrtpUserCallback.h>
#include <exception>
#include <map>
#include "noncopyable.h"
class SIPCall;
......@@ -57,6 +58,7 @@ class ZrtpSessionCallback: public ZrtpUserCallback {
void confirmGoClear();
private:
NON_COPYABLE(ZrtpSessionCallback);
SIPCall* sipcall_;
static std::map<int32, std::string> infoMap_;
static std::map<int32, std::string> warningMap_;
......
......@@ -33,7 +33,6 @@
#define __AUDIO_CODEC_H__
#include <string>
#include <iostream>
#include <dlfcn.h>
#include "codec.h"
......@@ -161,6 +160,7 @@ class AudioCodec : public Codec {
bool hasDynamicPayload_;
private:
AudioCodec& operator=(const AudioCodec&);
uint8 payload_;
ost::DynamicPayloadFormat* payloadFormat_;
......
......@@ -37,7 +37,8 @@
#include <algorithm> // for std::find
#include "fileutils.h"
AudioCodecFactory::AudioCodecFactory() : codecsMap_()
AudioCodecFactory::AudioCodecFactory() :
codecsMap_(), defaultCodecOrder_(), libCache_(), codecInMemory_()
{
typedef std::vector<sfl::Codec*> CodecVector;
CodecVector codecDynamicList(scanCodecDirectory());
......
......@@ -37,7 +37,7 @@
class Celt : public sfl::AudioCodec {
public:
Celt(int payload = 115) : sfl::AudioCodec(payload, "celt") {
Celt(int payload = 115) : sfl::AudioCodec(payload, "celt"), mode_(0), enc_(0), dec_(0) {
clockRate_ = 32000;
frameSize_ = 320; // fixed frameSize, TODO: support variable size from 64 to 512
channel_ = 1;
......@@ -119,14 +119,10 @@ class Celt : public sfl::AudioCodec {
}
private:
CELTMode *mode_;
CELTEncoder *enc_;
CELTDecoder *dec_;
celt_int32 celt_frame_size_;
celt_int32 skip_;
};
// the class factories
......
......@@ -36,34 +36,26 @@
#include "../common.h"
#include "audiocodec.h"
#include "g722.h"
#include "noncopyable.h"
#include <stdlib.h>
#include <string.h>
#include <cassert>
#define TRUE 1
#define FALSE 0
class G722 : public sfl::AudioCodec {
public:
G722(int payload=9)
: sfl::AudioCodec(payload, "G722") {
G722(int payload=9) : sfl::AudioCodec(payload, "G722"),
decode_s(new g722_decode_state_t),
encode_s(new g722_encode_state_t) {
clockRate_ = 16000;
frameSize_ = 320; // samples, 20 ms at 16kHz
channel_ = 1;
bitrate_ = 64;
hasDynamicPayload_ = false;
decode_s = new g722_decode_state_t;
encode_s = new g722_encode_state_t;
g722_decode_init();
g722_encode_init();
}
~G722() {
......@@ -84,17 +76,16 @@ class G722 : public sfl::AudioCodec {
void g722_encode_init() {
encode_s->itu_test_mode = FALSE;
encode_s->itu_test_mode = false;
// 8 => 64 kbps; 7 => 56 kbps; 6 => 48 kbps
encode_s->bits_per_sample = 8;
// Enable 8khz mode, encode using lower subband only
encode_s->eight_k = FALSE;
encode_s->eight_k = false;
// Never set packed TRUE when using 64 kbps
encode_s->packed = FALSE;
// Never set packed true when using 64 kbps
encode_s->packed = false;
memset(encode_s->band, 0, sizeof(decode_s->band));
encode_s->band[0].det = 32;
......@@ -110,16 +101,16 @@ class G722 : public sfl::AudioCodec {
void g722_decode_init() {
decode_s->itu_test_mode = FALSE;
decode_s->itu_test_mode = false;
// 8 => 64 kbps; 7 => 56 kbps; 6 => 48 kbps
decode_s->bits_per_sample = 8;
// Enable 8khz mode, encode using lower subband only
decode_s->eight_k = FALSE;
decode_s->eight_k = false;
// Never set packed TRUE when using 64 kbps
decode_s->packed = FALSE;
// Never set packed true when using 64 kbps
decode_s->packed = false;
memset(decode_s->band, 0, sizeof(decode_s->band));
decode_s->band[0].det = 32;
......@@ -811,6 +802,7 @@ class G722 : public sfl::AudioCodec {
}
private:
NON_COPYABLE(G722);
g722_decode_state_t *decode_s;
g722_encode_state_t *encode_s;
......@@ -828,4 +820,3 @@ extern "C" void destroy(sfl::Codec* a)
delete a;
}
......@@ -65,29 +65,32 @@ const SpeexMode* speexMode[3] = {
class Speex : public sfl::AudioCodec {
public:
Speex(int payload) : sfl::AudioCodec(payload, "speex") {
assert(payload >= 110 && payload <= 112);
assert(110 == PAYLOAD_CODEC_SPEEX_8000 &&
111 == PAYLOAD_CODEC_SPEEX_16000 &&
112 == PAYLOAD_CODEC_SPEEX_32000);
int type = payload - 110;
Speex(int payload) :
sfl::AudioCodec(payload, "speex"), speex_dec_bits_(),
speex_enc_bits_(), speex_dec_state_(0), speex_enc_state_(0),
speex_frame_size_(0) {
assert(payload >= 110 && payload <= 112);
assert(110 == PAYLOAD_CODEC_SPEEX_8000 &&
111 == PAYLOAD_CODEC_SPEEX_16000 &&
112 == PAYLOAD_CODEC_SPEEX_32000);
int type = payload - 110;
clockRate_ = clockRate[type];
frameSize_ = frameSize[type];
channel_ = 1;
bitrate_ = bitRate[type];
hasDynamicPayload_ = dynamicPayload[type];
clockRate_ = clockRate[type];
frameSize_ = frameSize[type];
channel_ = 1;
bitrate_ = bitRate[type];
hasDynamicPayload_ = dynamicPayload[type];
// Init the decoder struct
speex_bits_init(&speex_dec_bits_);
speex_dec_state_ = speex_decoder_init(speexMode[type]);
// Init the decoder struct
speex_bits_init(&speex_dec_bits_);
speex_dec_state_ = speex_decoder_init(speexMode[type]);
// Init the encoder struct
speex_bits_init(&speex_enc_bits_);
speex_enc_state_ = speex_encoder_init(speexMode[type]);
// Init the encoder struct
speex_bits_init(&speex_enc_bits_);
speex_enc_state_ = speex_encoder_init(speexMode[type]);
speex_encoder_ctl(speex_enc_state_, SPEEX_SET_SAMPLING_RATE, &clockRate_);
speex_decoder_ctl(speex_dec_state_, SPEEX_GET_FRAME_SIZE, &speex_frame_size_);
speex_encoder_ctl(speex_enc_state_, SPEEX_SET_SAMPLING_RATE, &clockRate_);
speex_decoder_ctl(speex_dec_state_, SPEEX_GET_FRAME_SIZE, &speex_frame_size_);
}
NON_COPYABLE(Speex);
......@@ -117,8 +120,8 @@ class Speex : public sfl::AudioCodec {
}
private:
SpeexBits speex_dec_bits_;
SpeexBits speex_enc_bits_;
SpeexBits speex_dec_bits_;
SpeexBits speex_enc_bits_;
void *speex_dec_state_;
void *speex_enc_state_;
int speex_frame_size_;
......
......@@ -97,11 +97,15 @@ void FirFilter::reset()
}
DelayDetection::DelayDetection() : internalState_(WaitForSpeaker), decimationFilter_(ird), bandpassFilter_(irb), segmentSize_(DELAY_BUFF_SIZE), downsamplingFactor_(8)
DelayDetection::DelayDetection() :
internalState_(WaitForSpeaker), decimationFilter_(ird),
bandpassFilter_(irb), segmentSize_(DELAY_BUFF_SIZE),
downsamplingFactor_(8),
spkrDownSize_(DELAY_BUFF_SIZE / downsamplingFactor_),
micDownSize_(WINDOW_SIZE / downsamplingFactor_),
nbMicSampleStored_(0),
nbSpkrSampleStored_(0)
{
micDownSize_ = WINDOW_SIZE / downsamplingFactor_;
spkrDownSize_ = DELAY_BUFF_SIZE / downsamplingFactor_;
memset(spkrReference_, 0, sizeof(float) *WINDOW_SIZE*2);
memset(capturedData_, 0, sizeof(float) *DELAY_BUFF_SIZE*2);
memset(spkrReferenceDown_, 0, sizeof(float) *WINDOW_SIZE*2);
......
......@@ -128,11 +128,6 @@ class DelayDetection {
int downsamplingFactor_;
/**
* Resulting correlation size (s + w -1)
*/
short correlationSize_;
float spkrReference_[WINDOW_SIZE*2];
float capturedData_[DELAY_BUFF_SIZE*2];
......@@ -147,8 +142,6 @@ class DelayDetection {
float correlationResult_[DELAY_BUFF_SIZE*2];
int remainingIndex_;
int spkrDownSize_;
int micDownSize_;
......
......@@ -14,15 +14,15 @@
#define SAMPLES_PER_FRAME 160
EchoSuppress::EchoSuppress(pj_pool_t *pool)
EchoSuppress::EchoSuppress(pj_pool_t *pool) : echoState_(0)
{
if (pjmedia_echo_create(pool, 8000, SAMPLES_PER_FRAME, 250, 0, PJMEDIA_ECHO_SIMPLE | PJMEDIA_ECHO_NO_LOCK, &echoState) != PJ_SUCCESS)
if (pjmedia_echo_create(pool, 8000, SAMPLES_PER_FRAME, 250, 0, PJMEDIA_ECHO_SIMPLE | PJMEDIA_ECHO_NO_LOCK, &echoState_) != PJ_SUCCESS)
throw std::runtime_error("EchoCancel: Could not create echo canceller");
}
EchoSuppress::~EchoSuppress()
{
pjmedia_echo_destroy(echoState);
pjmedia_echo_destroy(echoState_);
}
void EchoSuppress::putData(SFLDataFormat *inputData, int samples)
......@@ -30,7 +30,7 @@ void EchoSuppress::putData(SFLDataFormat *inputData, int samples)
assert(samples == SAMPLES_PER_FRAME);
assert(sizeof(SFLDataFormat) == sizeof(pj_int16_t));
if (pjmedia_echo_playback(echoState, reinterpret_cast<pj_int16_t *>(inputData)) != PJ_SUCCESS)
if (pjmedia_echo_playback(echoState_, reinterpret_cast<pj_int16_t *>(inputData)) != PJ_SUCCESS)
WARN("EchoCancel: Problem while putting input data");
}
......@@ -38,6 +38,6 @@ void EchoSuppress::getData(SFLDataFormat *outputData)
{
assert(sizeof(SFLDataFormat) == sizeof(pj_int16_t));
if (pjmedia_echo_capture(echoState, reinterpret_cast<pj_int16_t *>(outputData), 0) != PJ_SUCCESS)
if (pjmedia_echo_capture(echoState_, reinterpret_cast<pj_int16_t *>(outputData), 0) != PJ_SUCCESS)
WARN("EchoCancel: Problem while getting output data");
}
......@@ -10,6 +10,7 @@
#include "pjmedia/echo.h"
#include "global.h"
#include "noncopyable.h"
class EchoSuppress {
public:
......@@ -26,11 +27,12 @@ class EchoSuppress {
void getData(SFLDataFormat *);
private:
NON_COPYABLE(EchoSuppress);
/**
* The internal state of the echo canceller
*/
pjmedia_echo_state *echoState;
pjmedia_echo_state *echoState_;
};
#endif /* ECHOSUPPRESS_H_ */
......@@ -33,7 +33,7 @@
#include <utility> // for std::pair
#include "manager.h"
MainBuffer::MainBuffer() : internalSamplingRate_(8000)
MainBuffer::MainBuffer() : ringBufferMap_(), callIDMap_(), mutex_(), internalSamplingRate_(8000)
{}
MainBuffer::~MainBuffer()
......
......@@ -32,7 +32,7 @@
#include "pulselayer.h"
AudioStream::AudioStream(pa_context *c, pa_threaded_mainloop *m, const char *desc, int type, int smplrate, std::string *deviceName)
: mainloop_(m)
: audiostream_(0), mainloop_(m)
{
static const pa_channel_map channel_map = {
1,
......
......@@ -70,8 +70,11 @@ PulseLayer::PulseLayer()
: playback_(0)
, record_(0)
, ringtone_(0)
, sinkList_()
, sourceList_()
, mic_buffer_(0)
, mic_buf_size_(0)
, context_(0)
, mainloop_(pa_threaded_mainloop_new())
{
setenv("PULSE_PROP_media.role", "phone", 1);
......
......@@ -30,7 +30,7 @@
#include "recordable.h"
#include "manager.h"
Recordable::Recordable() : recorder(&recAudio, Manager::instance().getMainBuffer())
Recordable::Recordable() : recAudio(), recorder(&recAudio, Manager::instance().getMainBuffer())
{
recAudio.setRecordingOption(AudioRecord::FILE_WAV, 8000, Manager::instance().audioPreference.getRecordpath());
}
......
......@@ -38,7 +38,6 @@ class Recordable {
public:
Recordable();
virtual ~Recordable();
/**
......@@ -93,7 +92,6 @@ class Recordable {
AudioRecord recAudio;
AudioRecorder recorder;
};
#endif
......@@ -48,7 +48,10 @@ int RingBuffer::count_rb = 0;
RingBuffer::RingBuffer(int size, const std::string &call_id) : endPos_(0)
, bufferSize_(size > MIN_BUFFER_SIZE ? size : MIN_BUFFER_SIZE)
, buffer_(NULL)
, readpointer_()
, buffer_id_(call_id)
, buffer_input_rec(0)
, buffer_output_rec(0)
{
buffer_ = new unsigned char[bufferSize_];
count_rb++;
......
......@@ -32,7 +32,8 @@
#include "manager.h"
#include <cassert>
SamplerateConverter::SamplerateConverter(int freq) : maxFreq_(freq)
SamplerateConverter::SamplerateConverter(int freq) : floatBufferIn_(0),
floatBufferOut_(0), samples_(0), maxFreq_(freq), src_state_(0)
{
int err;
src_state_ = src_new(SRC_LINEAR, 1, &err);
......
......@@ -52,6 +52,7 @@ class AudioFileException : public std::runtime_error {
*/
class AudioFile : public AudioLoop {
public:
AudioFile() : filepath_() {}
std::string getFilePath() const {
return filepath_;
}
......
......@@ -30,42 +30,37 @@
// number of sample to process, (800 à 4000 samples, 100 to 500 ms)
#define EC_FILTER_LENGTH 800
namespace {
const int SPEEX_SAMPLE_RATE = 8000;
const int RINGBUFFER_SIZE = 100000;
}
SpeexEchoCancel::SpeexEchoCancel()
SpeexEchoCancel::SpeexEchoCancel() :
echoDelay_(Manager::instance().getEchoCancelDelay() * SPEEX_SAMPLE_RATE / 1000),
echoTailLength_(Manager::instance().getEchoCancelTailLength() * SPEEX_SAMPLE_RATE / 1000),
echoState_(speex_echo_state_init(EC_FRAME_SIZE, echoTailLength_)),
preState_(speex_preprocess_state_init(EC_FRAME_SIZE, SPEEX_SAMPLE_RATE)),
micData_(new RingBuffer(RINGBUFFER_SIZE)),
spkrData_(new RingBuffer(RINGBUFFER_SIZE)),
spkrStopped_(true)
{
int samplingRate = 8000;
int echoDelayMs = Manager::instance().getEchoCancelDelay();
int echoTailLengthMs = Manager::instance().getEchoCancelTailLength();
echoDelay_ = echoDelayMs * samplingRate / 1000;
echoTailLength_ = echoTailLengthMs * samplingRate / 1000;
// echoState_ = speex_echo_state_init (EC_FRAME_SIZE, EC_FILTER_LENGTH);
echoState_ = speex_echo_state_init(EC_FRAME_SIZE, echoTailLength_);
preState_ = speex_preprocess_state_init(EC_FRAME_SIZE, samplingRate);
DEBUG("EchoCancel: Initializing echo canceller with delay: %d, filter length: %d, frame size: %d and samplerate %d",
echoDelay_, echoTailLength_, EC_FRAME_SIZE, samplingRate);
echoDelay_, echoTailLength_, EC_FRAME_SIZE, SPEEX_SAMPLE_RATE);
speex_echo_ctl(echoState_, SPEEX_ECHO_SET_SAMPLING_RATE, &samplingRate);
int rate = SPEEX_SAMPLE_RATE;
speex_echo_ctl(echoState_, SPEEX_ECHO_SET_SAMPLING_RATE, &rate);
speex_preprocess_ctl(preState_, SPEEX_PREPROCESS_SET_ECHO_STATE, echoState_);
micData_ = new RingBuffer(100000);
spkrData_ = new RingBuffer(100000);
micData_->createReadPointer();
spkrData_->createReadPointer();
spkrStopped_ = true;
}