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
1f85379f
Commit
1f85379f
authored
Jun 28, 2010
by
Alexandre Savard
Browse files
[#2165] Fix inclusion errors for audio recorder
parent
70ccd93d
Changes
17
Show whitespace changes
Inline
Side-by-side
sflphone-common/configure.ac
View file @
1f85379f
...
...
@@ -61,7 +61,6 @@ AC_CONFIG_FILES([Makefile])
src/audio/codecs/Makefile \
src/config/Makefile \
src/dbus/Makefile \
src/plug-in/audiorecorder/Makefile \
src/plug-in/Makefile \
src/plug-in/test/Makefile \
src/hooks/Makefile \
...
...
sflphone-common/src/Makefile.am
View file @
1f85379f
...
...
@@ -93,7 +93,6 @@ libsflphone_la_LIBADD = \
./dbus/libdbus.la
\
./config/libconfig.la
\
./plug-in/libplugin.la
\
./plug-in/audiorecorder/libaudiorecorder.la
\
./hooks/libhooks.la
\
./history/libhistory.la
...
...
sflphone-common/src/audio/Makefile.am
View file @
1f85379f
...
...
@@ -12,6 +12,8 @@ libaudio_la_SOURCES = \
audioloop.cpp
\
ringbuffer.cpp
\
mainbuffer.cpp
\
audiorecord.cpp
\
audiorecorder.cpp
\
recordable.cpp
\
audiolayer.cpp
\
audiodevice.cpp
\
...
...
@@ -28,9 +30,11 @@ noinst_HEADERS = \
audioloop.h
\
common.h
\
ringbuffer.h
\
mainbuffer.h
\
audiorecord.h
\
audiorecorder.h
\
audiolayer.h
\
audiodevice.h
\
mainbuffer.h
\
recordable.h
\
algorithm.h
\
delaydetection.h
\
...
...
sflphone-common/src/audio/alsa/Makefile.am
View file @
1f85379f
sflphone-common/src/audio/audiolayer.h
View file @
1f85379f
...
...
@@ -37,20 +37,17 @@
#include
"audiodevice.h"
#include
"ringbuffer.h"
#include
"mainbuffer.h"
#include
<cc++/thread.h>
// for ost::Mutex
#include
"dcblocker.h"
#include
"speexechocancel.h"
#include
"echocancel.h"
#include
<cc++/thread.h>
// for ost::Mutex
/**
* @file audiolayer.h
* @brief Main sound class. Manages the data transfers between the application and the hardware.
*/
class
Recordable
;
class
ManagerImpl
;
class
AudioLayer
{
...
...
sflphone-common/src/
plug-in/audiorecorder
/audiorecord.cpp
→
sflphone-common/src/
audio
/audiorecord.cpp
View file @
1f85379f
File moved
sflphone-common/src/
plug-in/audiorecorder
/audiorecord.h
→
sflphone-common/src/
audio
/audiorecord.h
View file @
1f85379f
...
...
@@ -36,10 +36,7 @@
#include
<stdlib.h>
#include
<sstream>
#include
"plug-in/plugin.h"
// #include "audiodsp.h"
// class AudioDSP;
#include
"global.h"
using
namespace
std
;
...
...
sflphone-common/src/
plug-in/audiorecorder
/audiorecorder.cpp
→
sflphone-common/src/
audio
/audiorecorder.cpp
View file @
1f85379f
...
...
@@ -44,8 +44,16 @@ AudioRecorder::AudioRecorder (AudioRecord *arec)
*/
void
AudioRecorder
::
run
(
void
)
{
/*
while(true) {
SFLDataFormat
buffer
[
10000
];
_debug("Audiorecord");
sleep(1);
}
*/
// SFLDataFormat buffer[10000];
// int availBytes = mbuffer->availForGet(recorderId);
...
...
sflphone-common/src/
plug-in/audiorecorder
/audiorecorder.h
→
sflphone-common/src/
audio
/audiorecorder.h
View file @
1f85379f
...
...
@@ -35,6 +35,8 @@
#include
"audiorecord.h"
#include
<string>
class
MainBuffer
;
class
AudioRecorder
:
public
ost
::
Thread
{
public:
...
...
@@ -50,10 +52,10 @@ class AudioRecorder : public ost::Thread {
AudioRecorder
(
const
AudioRecorder
&
ar
);
AudioRecorder
&
operator
=
(
const
AudioRecorder
&
ar
);
// MainBuffer *mbuffer;
std
::
string
recorderId
;
MainBuffer
*
mbuffer
;
AudioRecord
*
arecord
;
};
...
...
sflphone-common/src/audio/mainbuffer.h
View file @
1f85379f
...
...
@@ -37,12 +37,10 @@
#include
<cc++/thread.h>
// for ost::Mutex
#include
<string>
#include
"
../
global.h"
#include
"
../
call.h"
#include
"global.h"
#include
"call.h"
#include
"ringbuffer.h"
typedef
std
::
map
<
CallID
,
RingBuffer
*>
RingBufferMap
;
typedef
std
::
set
<
CallID
>
CallIDSet
;
...
...
sflphone-common/src/audio/recordable.cpp
View file @
1f85379f
...
...
@@ -29,7 +29,6 @@
#include
"recordable.h"
#include
"manager.h"
#include
"mainbuffer.h"
Recordable
::
Recordable
()
:
recorder
(
&
recAudio
)
{
...
...
sflphone-common/src/audio/recordable.h
View file @
1f85379f
...
...
@@ -30,8 +30,8 @@
#ifndef RECORDABLE_H
#define RECORDABLE_H
#include
"
../plug-in/audiorecorder/
audiorecord.h"
#include
"
../plug-in/audiorecorder/
audiorecorder.h"
#include
"audiorecord.h"
#include
"audiorecorder.h"
class
Recordable
{
...
...
@@ -41,14 +41,30 @@ class Recordable {
~
Recordable
();
/**
* Return recording state (true/false)
*/
bool
isRecording
(){
return
recAudio
.
isRecording
();
}
/**
* This method must be implemented for this interface as calls and conferences
* have different behavior.
*/
virtual
bool
setRecording
()
=
0
;
/**
* Stop recording
*/
void
stopRecording
(){
recAudio
.
stopRecording
();
}
/**
* Init the recording file name according to path specified in configuration
*/
void
initRecFileName
();
/**
* Set recording sampling rate.
*/
void
setRecordingSmplRate
(
int
smplRate
);
virtual
std
::
string
getRecFileId
()
=
0
;
...
...
@@ -64,11 +80,6 @@ class Recordable {
AudioRecorder
recorder
;
private:
/** File name for his call : time YY-MM-DD */
// std::string _filename;
};
#endif
sflphone-common/src/call.h
View file @
1f85379f
...
...
@@ -35,7 +35,6 @@
#include
<cc++/thread.h>
// for mutex
#include
<sstream>
// #include "plug-in/audiorecorder/audiorecord.h"
#include
"audio/recordable.h"
#define SIP_SCHEME "sip:"
...
...
sflphone-common/src/plug-in/Makefile.am
View file @
1f85379f
include
../../globals.mak
SUBDIRS
=
audiorecorder
test
SUBDIRS
=
test
noinst_LTLIBRARIES
=
libplugin.la
...
...
sflphone-common/src/plug-in/audiorecorder/Makefile.am
deleted
100644 → 0
View file @
70ccd93d
include
$(top_srcdir)/globals.mak
noinst_LTLIBRARIES
=
libaudiorecorder.la
libaudiorecorder_la_SOURCES
=
\
audiorecord.cpp
\
audiorecorder.cpp
\ No newline at end of file
sflphone-common/src/plug-in/audiorecorder/audiodsp.cpp
deleted
100644 → 0
View file @
70ccd93d
/*
* Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc.
* Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
*
* This program 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 3 of the License, or
* (at your option) any later version.
*
* This program 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#include
"audiodsp.h"
AudioDSP
::
AudioDSP
()
{
bufPointer_
=
0
;
bufferLength_
=
1024
;
circBuffer_
=
new
float
[
bufferLength_
];
}
AudioDSP
::~
AudioDSP
()
{
delete
[]
circBuffer_
;
}
float
AudioDSP
::
getRMS
(
int
data
)
{
// printf("AudioDSP::getRMS() : bufPointer_ %i ", bufPointer_);
printf
(
"AudioDSP::getRMS() : %i "
,
data
);
circBuffer_
[
bufPointer_
++
]
=
(
float
)
data
;
if
(
bufPointer_
>=
bufferLength_
)
bufPointer_
=
0
;
return
computeRMS
();
}
float
AudioDSP
::
computeRMS
()
{
rms
=
0.0
;
for
(
int
i
=
0
;
i
<
bufferLength_
;
i
++
)
{
// printf("AudioDSP::computeRMS() : i_ %i ", i);
rms
+=
(
float
)
(
circBuffer_
[
i
]
*
circBuffer_
[
i
]);
}
rms
=
sqrt
(
rms
/
(
float
)
bufferLength_
);
// printf("AudioDSP::computeRMS() : RMS VALUE: %f ", rms);
return
rms
;
}
sflphone-common/src/plug-in/audiorecorder/audiodsp.h
deleted
100644 → 0
View file @
70ccd93d
/*
* Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc.
* Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
*
* This program 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 3 of the License, or
* (at your option) any later version.
*
* This program 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef _AUDIO_DSP_H
#define _AUDIO_DSP_H
#include
<math.h>
#include
<iostream>
#include
<string.h>
#include
<stdlib.h>
#include
<sstream>
class
AudioDSP
{
public:
AudioDSP
();
~
AudioDSP
();
/**
* Return rms value
*/
float
getRMS
(
int
data
);
protected:
/**
* Compute Rms value
*/
float
computeRMS
();
/**
* Internal buffer pointer
*/
int
bufPointer_
;
/**
* Internal buffer length
*/
int
bufferLength_
;
/**
* Internal buffer to compute RMS
*/
float
*
circBuffer_
;
/**
* Variable to compute RMS value
*/
float
rms
;
};
#endif // _AUDIO_DSP_H
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