projects
/
vamp-aubio-plugins.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d8075e2
)
...
author
Chris Cannam
<cannam@all-day-breakfast.com>
Tue, 9 Oct 2007 15:56:50 +0000
(15:56 +0000)
committer
Chris Cannam
<cannam@all-day-breakfast.com>
Tue, 9 Oct 2007 15:56:50 +0000
(15:56 +0000)
plugins/Silence.cpp
patch
|
blob
|
history
diff --git
a/plugins/Silence.cpp
b/plugins/Silence.cpp
index
01d516b
..
c7d2713
100644
(file)
--- a/
plugins/Silence.cpp
+++ b/
plugins/Silence.cpp
@@
-11,7
+11,6
@@
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version. See the file
COPYING included with this distribution for more information.
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version. See the file
COPYING included with this distribution for more information.
-
*/
#include <math.h>
*/
#include <math.h>
@@
-27,7
+26,7
@@
Silence::Silence(float inputSampleRate) :
m_ibuf(0),
m_pbuf(0),
m_tmpptrs(0),
m_ibuf(0),
m_pbuf(0),
m_tmpptrs(0),
- m_threshold(-
7
0),
+ m_threshold(-
8
0),
m_prevSilent(false),
m_first(true)
{
m_prevSilent(false),
m_first(true)
{
@@
-119,7
+118,7
@@
Silence::getParameterDescriptors() const
desc.name = "Silence Threshold";
desc.minValue = -120;
desc.maxValue = 0;
desc.name = "Silence Threshold";
desc.minValue = -120;
desc.maxValue = 0;
- desc.defaultValue = -
7
0;
+ desc.defaultValue = -
8
0;
desc.unit = "dB";
desc.isQuantized = false;
list.push_back(desc);
desc.unit = "dB";
desc.isQuantized = false;
list.push_back(desc);
@@
-152,11
+151,12
@@
Silence::getOutputDescriptors() const
OutputDescriptor d;
d.identifier = "silencestart";
OutputDescriptor d;
d.identifier = "silencestart";
- d.name = "
Start
s of Silent Regions";
+ d.name = "
Beginning
s of Silent Regions";
d.description = "Return a single instant at the point where each silent region begins";
d.hasFixedBinCount = true;
d.binCount = 0;
d.sampleType = OutputDescriptor::VariableSampleRate;
d.description = "Return a single instant at the point where each silent region begins";
d.hasFixedBinCount = true;
d.binCount = 0;
d.sampleType = OutputDescriptor::VariableSampleRate;
+ d.sampleRate = 0;
list.push_back(d);
d.identifier = "silenceend";
list.push_back(d);
d.identifier = "silenceend";
@@
-165,6
+165,7
@@
Silence::getOutputDescriptors() const
d.hasFixedBinCount = true;
d.binCount = 0;
d.sampleType = OutputDescriptor::VariableSampleRate;
d.hasFixedBinCount = true;
d.binCount = 0;
d.sampleType = OutputDescriptor::VariableSampleRate;
+ d.sampleRate = 0;
list.push_back(d);
d.identifier = "silencelevel";
list.push_back(d);
d.identifier = "silencelevel";
@@
-178,6
+179,7
@@
Silence::getOutputDescriptors() const
d.isQuantized = true;
d.quantizeStep = 1;
d.sampleType = OutputDescriptor::VariableSampleRate;
d.isQuantized = true;
d.quantizeStep = 1;
d.sampleType = OutputDescriptor::VariableSampleRate;
+ d.sampleRate = 0;
list.push_back(d);
return list;
list.push_back(d);
return list;
@@
-213,17
+215,12
@@
Silence::process(const float *const *inputBuffers,
vec.channels = m_channelCount;
vec.data = m_tmpptrs;
vec.channels = m_channelCount;
vec.data = m_tmpptrs;
- if (silent) {
- std::cerr << "silence at " << timestamp << std::endl;
- }
-
for (size_t i = 0; i < m_stepSize - incr * 4; i += incr) {
for (size_t j = 0; j < m_channelCount; ++j) {
m_tmpptrs[j] = m_ibuf->data[j] + i;
}
bool subsilent = aubio_silence_detection(&vec, m_threshold);
if (silent == subsilent) {
for (size_t i = 0; i < m_stepSize - incr * 4; i += incr) {
for (size_t j = 0; j < m_channelCount; ++j) {
m_tmpptrs[j] = m_ibuf->data[j] + i;
}
bool subsilent = aubio_silence_detection(&vec, m_threshold);
if (silent == subsilent) {
- std::cerr << "silent == subsilent at " << i << " after" << std::endl;
off = i;
break;
}
off = i;
break;
}
@@
-236,11
+233,8
@@
Silence::process(const float *const *inputBuffers,
}
bool subsilent = aubio_silence_detection(&vec, m_threshold);
if (!subsilent) {
}
bool subsilent = aubio_silence_detection(&vec, m_threshold);
if (!subsilent) {
- std::cerr << "non-silence at " << i << " samples before" << std::endl;
off = -(long)i;
break;
off = -(long)i;
break;
- } else {
- std::cerr << "silence at " << i << " samples before" << std::endl;
}
}
} else {
}
}
} else {