Skip to content
Snippets Groups Projects
Commit 15535526 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

#5814: Dump echo cancel file to disk

parent 4870710a
Branches
Tags
No related merge requests found
...@@ -57,6 +57,8 @@ SpeexEchoCancel::SpeexEchoCancel() ...@@ -57,6 +57,8 @@ SpeexEchoCancel::SpeexEchoCancel()
micFile = new ofstream("test_mic_data.raw"); micFile = new ofstream("test_mic_data.raw");
spkrFile = new ofstream("test_spkr_data.raw"); spkrFile = new ofstream("test_spkr_data.raw");
micProcessFile = new ofstream("test_mic_data_process.raw", std::ofstream::out);
spkrProcessFile = new ofstream("test_spkr_data_process.raw", std::ofstream::out);
echoFile = new ofstream("test_echo_data.raw"); echoFile = new ofstream("test_echo_data.raw");
_spkrStopped = true; _spkrStopped = true;
...@@ -80,6 +82,8 @@ SpeexEchoCancel::~SpeexEchoCancel() ...@@ -80,6 +82,8 @@ SpeexEchoCancel::~SpeexEchoCancel()
delete micFile; delete micFile;
delete spkrFile; delete spkrFile;
delete micProcessFile;
delete spkrProcessFile;
delete echoFile; delete echoFile;
} }
...@@ -97,6 +101,8 @@ void SpeexEchoCancel::putData (SFLDataFormat *inputData, int nbBytes) ...@@ -97,6 +101,8 @@ void SpeexEchoCancel::putData (SFLDataFormat *inputData, int nbBytes)
_spkrStopped = false; _spkrStopped = false;
} }
spkrFile->write(reinterpret_cast<char *>(inputData), nbBytes);
// Put data in speaker ring buffer // Put data in speaker ring buffer
_spkrData->Put (inputData, nbBytes); _spkrData->Put (inputData, nbBytes);
...@@ -125,6 +131,8 @@ int SpeexEchoCancel::process (SFLDataFormat *inputData, SFLDataFormat *outputDat ...@@ -125,6 +131,8 @@ int SpeexEchoCancel::process (SFLDataFormat *inputData, SFLDataFormat *outputDat
memset (_tmpMic, 0, 5000 * sizeof(SFLDataFormat)); memset (_tmpMic, 0, 5000 * sizeof(SFLDataFormat));
memset (_tmpOut, 0, 5000 * sizeof(SFLDataFormat)); memset (_tmpOut, 0, 5000 * sizeof(SFLDataFormat));
micFile->write(reinterpret_cast<char *>(inputData), nbBytes);
// Put mic data in ringbuffer // Put mic data in ringbuffer
_micData->Put (inputData, nbBytes); _micData->Put (inputData, nbBytes);
...@@ -143,8 +151,8 @@ int SpeexEchoCancel::process (SFLDataFormat *inputData, SFLDataFormat *outputDat ...@@ -143,8 +151,8 @@ int SpeexEchoCancel::process (SFLDataFormat *inputData, SFLDataFormat *outputDat
_spkrData->Get (_tmpSpkr, byteSize); _spkrData->Get (_tmpSpkr, byteSize);
_micData->Get (_tmpMic, byteSize); _micData->Get (_tmpMic, byteSize);
micFile->write(reinterpret_cast<char *>(_tmpMic), byteSize); micProcessFile->write(reinterpret_cast<char *>(_tmpMic), byteSize);
spkrFile->write(reinterpret_cast<char *>(_tmpSpkr), byteSize); spkrProcessFile->write(reinterpret_cast<char *>(_tmpSpkr), byteSize);
// speex_preprocess_run (_preState, _tmpMic); // speex_preprocess_run (_preState, _tmpMic);
......
...@@ -87,6 +87,8 @@ class SpeexEchoCancel : public Algorithm ...@@ -87,6 +87,8 @@ class SpeexEchoCancel : public Algorithm
ofstream *micFile; ofstream *micFile;
ofstream *spkrFile; ofstream *spkrFile;
ofstream *micProcessFile;
ofstream *spkrProcessFile;
ofstream *echoFile; ofstream *echoFile;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment