Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
e7fca1e2
Commit
e7fca1e2
authored
Apr 21, 2010
by
Alexandre Savard
Browse files
[#1966] Instantiate AudioProcessing and EchoCanceller class
parent
f215bcbc
Changes
7
Hide whitespace changes
Inline
Side-by-side
sflphone-common/src/audio/algorithm.h
View file @
e7fca1e2
...
...
@@ -17,6 +17,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef ALGORITHM_H
#define ALGORITHM_H
#include
"global.h"
/**
...
...
@@ -28,11 +31,6 @@ class Algorithm {
public:
/**
* Constructor for this class
*/
Algorithm
();
/**
* Class implementing this interface must define this function
* \param micData
...
...
@@ -40,3 +38,5 @@ class Algorithm {
virtual
void
process
(
SFLDataFormat
*
micData
,
SFLDataFormat
*
spkrData
,
SFLDataFormat
*
outputData
)
=
0
;
};
#endif
sflphone-common/src/audio/audioprocessing.cpp
View file @
e7fca1e2
...
...
@@ -29,6 +29,6 @@ AudioProcessing::~AudioProcessing(void){}
void
AudioProcessing
::
processAudio
(
SFLDataFormat
*
micData
,
SFLDataFormat
*
spkrData
,
SFLDataFormat
*
outputData
)
{
_algorithm
->
process
(
micData
,
spkrData
,
outputData
);
if
(
_algorithm
)
_algorithm
->
process
(
micData
,
spkrData
,
outputData
);
}
sflphone-common/src/audio/audioprocessing.h
View file @
e7fca1e2
...
...
@@ -17,6 +17,10 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef AUDIOPROCESSING_H
#define AUDIOPROCESSING_H
#include
"algorithm.h"
/**
...
...
@@ -49,3 +53,5 @@ private:
Algorithm
*
_algorithm
;
};
#endif
sflphone-common/src/audio/echocancel.cpp
View file @
e7fca1e2
...
...
@@ -25,6 +25,6 @@ EchoCancel::EchoCancel() {}
EchoCancel
::~
EchoCancel
()
{}
void
EchoCancel
::
process
(
SFLDataFormat
*
micData
,
SFLDataFormat
*
spkrData
,
SFLDataFormat
*
outputData
)
{
}
sflphone-common/src/audio/echocancel.h
View file @
e7fca1e2
...
...
@@ -17,10 +17,15 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef ECHOCANCEL_H
#define ECHOCANCEL_H
#include
"audioprocessing.h"
#include
<speex/speex_echo.h>
class
EchoCancel
:
Algorithm
{
class
EchoCancel
:
public
Algorithm
{
public:
EchoCancel
();
...
...
@@ -34,3 +39,5 @@ class EchoCancel : Algorithm {
*/
virtual
void
process
(
SFLDataFormat
*
micData
,
SFLDataFormat
*
spkrData
,
SFLDataFormat
*
outputData
);
};
#endif
sflphone-common/src/audio/mainbuffer.cpp
View file @
e7fca1e2
...
...
@@ -20,17 +20,25 @@
#include
"mainbuffer.h"
#include
"audioprocessing.h"
MainBuffer
::
MainBuffer
()
:
_internalSamplingRate
(
0
)
{
mixBuffer
=
new
SFLDataFormat
[
STATIC_BUFSIZE
];
_echoCancel
=
new
EchoCancel
();
_audioProcessing
=
new
AudioProcessing
(
static_cast
<
Algorithm
*>
(
_echoCancel
));
}
MainBuffer
::~
MainBuffer
()
{
delete
[]
mixBuffer
;
mixBuffer
=
NULL
;
delete
[]
mixBuffer
;
mixBuffer
=
NULL
;
delete
_echoCancel
;
_echoCancel
=
NULL
;
delete
_audioProcessing
;
_audioProcessing
=
NULL
;
}
...
...
sflphone-common/src/audio/mainbuffer.h
View file @
e7fca1e2
...
...
@@ -29,6 +29,8 @@
#include
"../global.h"
#include
"../call.h"
#include
"ringbuffer.h"
#include
"echocancel.h"
#include
"algorithm.h"
...
...
@@ -110,6 +112,10 @@ public:
int
_internalSamplingRate
;
EchoCancel
*
_echoCancel
;
AudioProcessing
*
_audioProcessing
;
public:
friend
class
MainBufferTest
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment