[BUILD] update new lutin 0.5.3

This commit is contained in:
Edouard DUPIN 2015-05-08 22:34:13 +02:00
parent ab7f5ac771
commit 0102140e99
8 changed files with 56 additions and 53 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/python
import lutinModule as module
import lutinTools as tools
import lutinDebug as debug
import lutin.module as module
import lutin.tools as tools
import lutin.debug as debug
def get_desc():
return "audio_drain : Basic audio algo interface single pipe to provess data"
@ -30,7 +30,7 @@ def create(target):
])
# TODO: myModule.add_optional_module_depend('speexdsp', "HAVE_SPEEX_DSP_RESAMPLE")
myModule.compile_flags_CC("-DHAVE_SPEEX_DSP_RESAMPLE")
myModule.compile_flags('c++', "-DHAVE_SPEEX_DSP_RESAMPLE")
myModule.add_module_depend(['etk', 'audio', 'ejson', 'speexdsp', 'audio_algo_drain'])
myModule.add_export_path(tools.get_current_path(__file__))

View File

@ -1,7 +1,7 @@
#!/usr/bin/python
import lutinModule as module
import lutinTools as tools
import lutinDebug as debug
import lutin.module as module
import lutin.tools as tools
import lutin.debug as debug
def get_desc():
return "drain_test : single audio flow test"

View File

@ -13,13 +13,14 @@
#include <ewol/widget/Entry.h>
#include <ewol/widget/Button.h>
#include <ewol/widget/Slider.h>
#include <audio/drain/Equalizer.h>
#undef __class__
#define __class__ "Windows"
appl::Windows::Windows() :
m_sampleRate(48000),
m_type(drain::filterType::filterType_lowPass),
m_type(audio::algo::drain::biQuadType_lowPass),
m_cutFrequency(8000.0),
m_gain(0.0),
m_quality(0.707) {
@ -36,14 +37,14 @@ appl::Windows::Windows() :
m_listSampleRate.push_back(11025);
m_listSampleRate.push_back(8000);
m_listSampleRate.push_back(4000);
m_listType.push_back(drain::filterType_none);
m_listType.push_back(drain::filterType_lowPass);
m_listType.push_back(drain::filterType_highPass);
m_listType.push_back(drain::filterType_bandPass);
m_listType.push_back(drain::filterType_notch);
m_listType.push_back(drain::filterType_peak);
m_listType.push_back(drain::filterType_lowShelf);
m_listType.push_back(drain::filterType_highShelf);
m_listType.push_back(audio::algo::drain::biQuadType_none);
m_listType.push_back(audio::algo::drain::biQuadType_lowPass);
m_listType.push_back(audio::algo::drain::biQuadType_highPass);
m_listType.push_back(audio::algo::drain::biQuadType_bandPass);
m_listType.push_back(audio::algo::drain::biQuadType_notch);
m_listType.push_back(audio::algo::drain::biQuadType_peak);
m_listType.push_back(audio::algo::drain::biQuadType_lowShelf);
m_listType.push_back(audio::algo::drain::biQuadType_highShelf);
}
void appl::Windows::init() {
@ -201,17 +202,20 @@ void appl::Windows::onCallbackFrequencySlider(const float& _value) {
onCallbackStart();
}
#include <river/debug.h>
#include <audio/river/debug.h>
#include <audio/algo/drain/BiQuad.h>
#include <audio/float_t.h>
#include <audio/int16_16_t.h>
void appl::Windows::onCallbackStart() {
APPL_INFO("start ");
int32_t iii = 10;
std::vector<audio::channel> map;
map.push_back(audio::channel_frontCenter);
//drain::IOFormatInterface format(map, audio::format_int16, m_sampleRate);
drain::IOFormatInterface format(map, audio::format_float, m_sampleRate);
// audio::drain::IOFormatInterface format(map, audio::format_int16, m_sampleRate);
// audio::drain::IOFormatInterface format(map, audio::format_float, m_sampleRate);
// create biquad
drain::BiQuadFloat bq;
audio::algo::drain::BiQuad<audio::float_t> bq;
// configure parameter
bq.setBiquad(m_type, m_cutFrequency, m_quality, m_gain, m_sampleRate);
std::vector<std::pair<float,float> > theory = bq.calculateTheory(m_sampleRate);
@ -223,7 +227,7 @@ void appl::Windows::onCallbackStart() {
void appl::Windows::onCallbackStart16() {
APPL_INFO("start ");
// create biquad
drain::BiQuadFloat bq;
audio::algo::drain::BiQuad<audio::int16_16_t> bq;
// configure parameter
bq.setBiquad(m_type, m_cutFrequency, m_quality, m_gain, m_sampleRate);
std::vector<std::pair<float,float> > pratic;
@ -235,7 +239,7 @@ void appl::Windows::onCallbackStart16() {
double m_phase = 0;
double baseCycle = 2.0*M_PI/double(m_sampleRate) * double(freq);
float gain = 0;
std::vector<int16_t> data;
std::vector<audio::int16_16_t> data;
// create sinus
data.resize(16000, 0);
for (int32_t iii=0; iii<data.size(); iii++) {
@ -249,15 +253,14 @@ void appl::Windows::onCallbackStart16() {
int16_t* output = nullptr;
void* outputVoid = nullptr;
size_t outputNbChunk = 0;
std11::chrono::system_clock::time_point time;
RIVER_SAVE_FILE_MACRO(int16_t,"aaa_test_INPUT_16.raw",&data[0],data.size());
bq.processInt16(&data[0], &data[0], data.size(), 1, 1);
bq.process(&data[0], &data[0], data.size(), 1, 1);
RIVER_SAVE_FILE_MACRO(int16_t,"aaa_test_OUTPUT_16.raw",&data[0],data.size());
int16_t value = 0;
audio::int16_16_t value = 0;
for (size_t iii=800; iii<data.size()-200; ++iii) {
value = std::max(value, data[iii]);
}
gain = 20.0 * std::log10(double(value)/32000.0);
gain = 20.0 * std::log10(value.getDouble()/32000.0);
APPL_VERBOSE("LEVEL " << iii << " out = " << value << " % : " << gain);
pratic.push_back(std::make_pair<float, float>(float(freq),float(gain)));
}
@ -267,7 +270,7 @@ void appl::Windows::onCallbackStart16() {
void appl::Windows::onCallbackStartFloat() {
APPL_INFO("start ");
// create biquad
drain::BiQuadFloat bq;
audio::algo::drain::BiQuad<audio::float_t> bq;
// configure parameter
bq.setBiquad(m_type, m_cutFrequency, m_quality, m_gain, m_sampleRate);
std::vector<std::pair<float,float> > pratic;
@ -279,7 +282,7 @@ void appl::Windows::onCallbackStartFloat() {
double m_phase = 0;
double baseCycle = 2.0*M_PI/double(m_sampleRate) * double(freq);
float gain = 0;
std::vector<float> data;
std::vector<audio::float_t> data;
// create sinus
data.resize(16000, 0);
for (int32_t iii=0; iii<data.size(); iii++) {
@ -290,13 +293,13 @@ void appl::Windows::onCallbackStartFloat() {
}
}
RIVER_SAVE_FILE_MACRO(float,"aaa_test_INPUT_F.raw",&data[0],data.size());
bq.processFloat(&data[0], &data[0], data.size(), 1, 1);
bq.process(&data[0], &data[0], data.size(), 1, 1);
RIVER_SAVE_FILE_MACRO(float,"aaa_test_OUTPUT_F.raw",&data[0],data.size());
float value = 0.0f;
audio::float_t value = 0.0f;
for (size_t iii=800; iii<data.size()-200; ++iii) {
value = std::max(value, data[iii]);
}
gain = 20.0 * std::log10(double(value)/1.0);
gain = 20.0 * std::log10(value.getDouble()/1.0);
APPL_VERBOSE("LEVEL " << iii << " out = " << value << " % : " << gain);
pratic.push_back(std::make_pair<float, float>(float(freq),float(gain)));
}

View File

@ -12,7 +12,7 @@
#include <ewol/widget/Windows.h>
#include <ewol/widget/Layer.h>
#include <ewol/widget/Composer.h>
#include <drain/Equalizer.h>
#include <audio/algo/drain/BiQuadType.h>
#include <appl/widget/DisplayFrequency.h>
namespace appl {
@ -41,8 +41,8 @@ namespace appl {
protected:
int32_t m_sampleRate;
std::vector<int32_t> m_listSampleRate;
enum drain::filterType m_type;
std::vector<enum drain::filterType> m_listType;
enum audio::algo::drain::biQuadType m_type;
std::vector<enum audio::algo::drain::biQuadType> m_listType;
float m_cutFrequency;
float m_gain;
float m_quality;

View File

@ -1,6 +1,6 @@
#!/usr/bin/python
import lutinModule as module
import lutinTools as tools
import lutin.module as module
import lutin.tools as tools
# optionnal : Describe in the "lutin.py --help"
@ -17,9 +17,9 @@ def create(target):
'appl/widget/DisplayFrequency.cpp',
])
# add Library dependency name
myModule.add_module_depend(['ewol', 'drain', 'river'])
myModule.add_module_depend(['ewol', 'audio_drain', 'audio_river'])
# add application C flags
myModule.compile_flags_CC([
myModule.compile_flags('c++', [
"-DPROJECT_NAME=\"\\\""+myModule.name+"\\\"\""])
# Add current include Path
myModule.add_path(tools.get_current_path(__file__))

View File

@ -108,14 +108,14 @@ void appl::Windows::onCallbackGain(const float& _value, int32_t _id) {
}
#include <river/debug.h>
#include <audio/river/debug.h>
std11::shared_ptr<drain::Equalizer> appl::Windows::createEqualizer(enum audio::format _format) {
std11::shared_ptr<audio::drain::Equalizer> appl::Windows::createEqualizer(enum audio::format _format) {
std::vector<audio::channel> map;
map.push_back(audio::channel_frontCenter);
drain::IOFormatInterface format(map, _format, m_sampleRate);
audio::drain::IOFormatInterface format(map, _format, m_sampleRate);
// create equalizer
std11::shared_ptr<drain::Equalizer> out = drain::Equalizer::create();
std11::shared_ptr<audio::drain::Equalizer> out = audio::drain::Equalizer::create();
// configure input
out->setInputFormat(format);
// configure output
@ -160,7 +160,7 @@ std11::shared_ptr<drain::Equalizer> appl::Windows::createEqualizer(enum audio::f
void appl::Windows::onCallbackStart() {
APPL_INFO("start ");
std11::shared_ptr<drain::Equalizer> eq = appl::Windows::createEqualizer();
std11::shared_ptr<audio::drain::Equalizer> eq = appl::Windows::createEqualizer();
std::vector<std::pair<float,float> > theory = eq->calculateTheory();
m_displayer->clear();
m_displayer->setValue(theory);
@ -169,7 +169,7 @@ void appl::Windows::onCallbackStart() {
void appl::Windows::onCallbackStart16() {
APPL_INFO("start ");
std11::shared_ptr<drain::Equalizer> eq = appl::Windows::createEqualizer(audio::format_int16);
std11::shared_ptr<audio::drain::Equalizer> eq = appl::Windows::createEqualizer(audio::format_int16);
std::vector<std::pair<float,float> > pratic;
size_t len = 512;
std::vector<int16_t> data;
@ -192,7 +192,7 @@ void appl::Windows::onCallbackStart16() {
int16_t* output = nullptr;
void* outputVoid = nullptr;
size_t outputNbChunk = 0;
std11::chrono::system_clock::time_point time;
audio::Time time;
RIVER_SAVE_FILE_MACRO(int16_t, "aaa_test_INPUT.raw", &data[0], data.size());
eq->process(time, &data[0], data.size(), outputVoid, outputNbChunk);
output = static_cast<int16_t*>(outputVoid);
@ -210,7 +210,7 @@ void appl::Windows::onCallbackStart16() {
void appl::Windows::onCallbackStartFloat() {
APPL_INFO("start ");
std11::shared_ptr<drain::Equalizer> eq = appl::Windows::createEqualizer(audio::format_float);
std11::shared_ptr<audio::drain::Equalizer> eq = appl::Windows::createEqualizer(audio::format_float);
std::vector<std::pair<float,float> > pratic;
size_t len = 512;
std::vector<float> data;
@ -233,7 +233,7 @@ void appl::Windows::onCallbackStartFloat() {
float* output = nullptr;
void* outputVoid = nullptr;
size_t outputNbChunk = 0;
std11::chrono::system_clock::time_point time;
audio::Time time;
RIVER_SAVE_FILE_MACRO(int16_t,"aaa_test_INPUT_F.raw",&data[0],data.size());
eq->process(time, &data[0], data.size(), outputVoid, outputNbChunk);
output = static_cast<float*>(outputVoid);

View File

@ -12,7 +12,7 @@
#include <ewol/widget/Windows.h>
#include <ewol/widget/Layer.h>
#include <ewol/widget/Composer.h>
#include <drain/Equalizer.h>
#include <audio/drain/Equalizer.h>
#include <appl/widget/DisplayFrequency.h>
namespace appl {
@ -66,7 +66,7 @@ namespace appl {
std::vector<int32_t> m_listSampleRate;
std::vector<float> m_listGain;
std11::shared_ptr<drain::Equalizer> createEqualizer(enum audio::format _format = audio::format_float);
std11::shared_ptr<audio::drain::Equalizer> createEqualizer(enum audio::format _format = audio::format_float);
};
};

View File

@ -1,6 +1,6 @@
#!/usr/bin/python
import lutinModule as module
import lutinTools as tools
import lutin.module as module
import lutin.tools as tools
# optionnal : Describe in the "lutin.py --help"
@ -17,9 +17,9 @@ def create(target):
'appl/widget/DisplayFrequency.cpp',
])
# add Library dependency name
myModule.add_module_depend(['ewol', 'drain', 'river'])
myModule.add_module_depend(['ewol', 'audio_drain', 'audio_river'])
# add application C flags
myModule.compile_flags_CC([
myModule.compile_flags('c++', [
"-DPROJECT_NAME=\"\\\""+myModule.name+"\\\"\""])
# Add current include Path
myModule.add_path(tools.get_current_path(__file__))