[DEV] update new lutin 0.8.0
This commit is contained in:
parent
88c8178a72
commit
569d59e05a
@ -21,7 +21,7 @@
|
||||
#define __class__ "io::Manager"
|
||||
|
||||
#ifdef AUDIO_RIVER_BUILD_PORTAUDIO
|
||||
#include <portaudio.h>
|
||||
#include <portaudio/portaudio.h>
|
||||
#endif
|
||||
|
||||
static std::string basicAutoConfig =
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include <audio/river/Interface.h>
|
||||
#include <audio/river/io/Node.h>
|
||||
#include <portaudio.h>
|
||||
#include <portaudio/portaudio.h>
|
||||
|
||||
namespace audio {
|
||||
namespace river {
|
||||
|
@ -2,17 +2,34 @@
|
||||
import lutin.module as module
|
||||
import lutin.tools as tools
|
||||
|
||||
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
|
||||
def get_sub_type():
|
||||
return "TEST"
|
||||
|
||||
def get_desc():
|
||||
return "Multi-nodal audio interface test"
|
||||
|
||||
def get_licence():
|
||||
return "APACHE-2"
|
||||
|
||||
def create(target):
|
||||
my_module = module.Module(__file__, 'audio-river-test', 'BINARY')
|
||||
def get_compagny_type():
|
||||
return "com"
|
||||
|
||||
def get_compagny_name():
|
||||
return "atria-soft"
|
||||
|
||||
def get_maintainer():
|
||||
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
my_module.add_src_file([
|
||||
'test/main.cpp',
|
||||
'test/debug.cpp'
|
||||
'test/main.cpp'
|
||||
])
|
||||
my_module.add_module_depend(['audio-river', 'gtest', 'etk'])
|
||||
my_module.add_module_depend(['audio-river', 'gtest', 'etk', 'test-debug'])
|
||||
return my_module
|
||||
|
||||
|
||||
|
@ -2,13 +2,30 @@
|
||||
import lutin.module as module
|
||||
import lutin.tools as tools
|
||||
|
||||
|
||||
def get_type():
|
||||
return "LIBRARY"
|
||||
|
||||
def get_desc():
|
||||
return "Multi-nodal audio interface"
|
||||
|
||||
def get_licence():
|
||||
return "APACHE-2"
|
||||
|
||||
def create(target):
|
||||
my_module = module.Module(__file__, 'audio-river', 'LIBRARY')
|
||||
|
||||
def get_compagny_type():
|
||||
return "com"
|
||||
|
||||
def get_compagny_name():
|
||||
return "atria-soft"
|
||||
|
||||
def get_maintainer():
|
||||
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
||||
|
||||
def get_version():
|
||||
return [0,0,0]
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
my_module.add_src_file([
|
||||
'audio/river/debug.cpp',
|
||||
'audio/river/river.cpp',
|
||||
@ -34,8 +51,6 @@ def create(target):
|
||||
my_module.add_optionnal_module_depend('portaudio', ["c++", "-DAUDIO_RIVER_BUILD_PORTAUDIO"])
|
||||
my_module.add_module_depend(['audio', 'audio-drain', 'ejson'])
|
||||
my_module.add_path(tools.get_current_path(__file__))
|
||||
|
||||
# add the currrent module at the
|
||||
return my_module
|
||||
|
||||
|
||||
|
@ -2,12 +2,29 @@
|
||||
import lutin.module as module
|
||||
import lutin.tools as tools
|
||||
import datetime
|
||||
import os
|
||||
|
||||
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
|
||||
def get_desc():
|
||||
return "Simpleaudio IO viewer and test ..."
|
||||
|
||||
def create(target):
|
||||
my_module = module.Module(__file__, 'ioViewer', 'PACKAGE')
|
||||
def get_licence():
|
||||
return "APACHE-2"
|
||||
|
||||
def get_compagny_type():
|
||||
return "com"
|
||||
|
||||
def get_compagny_name():
|
||||
return "atria-soft"
|
||||
|
||||
def get_maintainer():
|
||||
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
my_module.add_extra_compile_flags()
|
||||
my_module.add_src_file([
|
||||
'appl/debug.cpp',
|
||||
|
@ -2,12 +2,30 @@
|
||||
import lutin.module as module
|
||||
import lutin.tools as tools
|
||||
|
||||
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
|
||||
def get_sub_type():
|
||||
return "SAMPLE"
|
||||
|
||||
def get_desc():
|
||||
return "Read some data"
|
||||
|
||||
def get_licence():
|
||||
return "APACHE-2"
|
||||
|
||||
def create(target):
|
||||
my_module = module.Module(__file__, 'river-sample-read', 'BINARY')
|
||||
def get_compagny_type():
|
||||
return "com"
|
||||
|
||||
def get_compagny_name():
|
||||
return "atria-soft"
|
||||
|
||||
def get_maintainer():
|
||||
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
my_module.add_src_file([
|
||||
'main.cpp',
|
||||
])
|
||||
|
@ -2,12 +2,30 @@
|
||||
import lutin.module as module
|
||||
import lutin.tools as tools
|
||||
|
||||
|
||||
def get_type():
|
||||
return "BINARY"
|
||||
|
||||
def get_sub_type():
|
||||
return "SAMPLE"
|
||||
|
||||
def get_desc():
|
||||
return "Write some data"
|
||||
|
||||
def get_licence():
|
||||
return "APACHE-2"
|
||||
|
||||
def create(target):
|
||||
my_module = module.Module(__file__, 'river-sample-write', 'BINARY')
|
||||
def get_compagny_type():
|
||||
return "com"
|
||||
|
||||
def get_compagny_name():
|
||||
return "atria-soft"
|
||||
|
||||
def get_maintainer():
|
||||
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
my_module.add_src_file([
|
||||
'main.cpp',
|
||||
])
|
||||
|
@ -1,15 +0,0 @@
|
||||
/**
|
||||
* @author Edouard DUPIN
|
||||
*
|
||||
* @copyright 2010, Edouard DUPIN, all right reserved
|
||||
*
|
||||
* @license GPL v3 (see license file)
|
||||
*/
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
int32_t appl::getLogId() {
|
||||
static int32_t g_val = etk::log::registerInstance("test");
|
||||
return g_val;
|
||||
}
|
||||
|
43
test/debug.h
43
test/debug.h
@ -1,43 +0,0 @@
|
||||
/**
|
||||
* @author Edouard DUPIN
|
||||
*
|
||||
* @copyright 2010, Edouard DUPIN, all right reserved
|
||||
*
|
||||
* @license GPL v3 (see license file)
|
||||
*/
|
||||
|
||||
#ifndef __APPL_DEBUG_H__
|
||||
#define __APPL_DEBUG_H__
|
||||
|
||||
#include <etk/log.h>
|
||||
|
||||
namespace appl {
|
||||
int32_t getLogId();
|
||||
};
|
||||
#define APPL_BASE(info,data) TK_LOG_BASE(appl::getLogId(),info,data)
|
||||
|
||||
#define APPL_PRINT(data) APPL_BASE(-1, data)
|
||||
#define APPL_CRITICAL(data) APPL_BASE(1, data)
|
||||
#define APPL_ERROR(data) APPL_BASE(2, data)
|
||||
#define APPL_WARNING(data) APPL_BASE(3, data)
|
||||
#ifdef DEBUG
|
||||
#define APPL_INFO(data) APPL_BASE(4, data)
|
||||
#define APPL_DEBUG(data) APPL_BASE(5, data)
|
||||
#define APPL_VERBOSE(data) APPL_BASE(6, data)
|
||||
#define APPL_TODO(data) APPL_BASE(4, "TODO : " << data)
|
||||
#else
|
||||
#define APPL_INFO(data) do { } while(false)
|
||||
#define APPL_DEBUG(data) do { } while(false)
|
||||
#define APPL_VERBOSE(data) do { } while(false)
|
||||
#define APPL_TODO(data) do { } while(false)
|
||||
#endif
|
||||
|
||||
#define APPL_ASSERT(cond,data) \
|
||||
do { \
|
||||
if (!(cond)) { \
|
||||
APPL_CRITICAL(data); \
|
||||
assert(!#cond); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
@ -4,7 +4,29 @@
|
||||
* @license APACHE v2.0 (see license file)
|
||||
*/
|
||||
|
||||
#include "debug.h"
|
||||
#include <test-debug/debug.h>
|
||||
|
||||
#define TEST_SAVE_FILE_MACRO(type,fileName,dataPointer,nbElement) \
|
||||
do { \
|
||||
static FILE *pointerOnFile = nullptr; \
|
||||
static bool errorOpen = false; \
|
||||
if (pointerOnFile == nullptr) { \
|
||||
TEST_WARNING("open file '" << fileName << "' type=" << #type); \
|
||||
pointerOnFile = fopen(fileName,"w"); \
|
||||
if ( errorOpen == false \
|
||||
&& pointerOnFile == nullptr) { \
|
||||
TEST_ERROR("ERROR OPEN file ... '" << fileName << "' type=" << #type); \
|
||||
errorOpen=true; \
|
||||
} \
|
||||
} \
|
||||
if (pointerOnFile != nullptr) { \
|
||||
fwrite((dataPointer), sizeof(type), (nbElement), pointerOnFile); \
|
||||
/* fflush(pointerOnFile);*/ \
|
||||
} \
|
||||
}while(0)
|
||||
|
||||
|
||||
|
||||
#include <audio/river/river.h>
|
||||
#include <audio/river/Manager.h>
|
||||
#include <audio/river/Interface.h>
|
||||
@ -38,8 +60,8 @@ int main(int _argc, const char** _argv) {
|
||||
std::string data = _argv[iii];
|
||||
if ( data == "-h"
|
||||
|| data == "--help") {
|
||||
APPL_PRINT("Help : ");
|
||||
APPL_PRINT(" ./xxx ---");
|
||||
TEST_PRINT("Help : ");
|
||||
TEST_PRINT(" ./xxx ---");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ namespace river_test_aec {
|
||||
audio::format_int16,
|
||||
_output);
|
||||
if(m_interfaceOut == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
@ -58,7 +58,7 @@ namespace river_test_aec {
|
||||
audio::format_int16,
|
||||
_input);
|
||||
if(m_interfaceIn == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
@ -79,7 +79,7 @@ namespace river_test_aec {
|
||||
uint32_t _frequency,
|
||||
const std::vector<audio::channel>& _map) {
|
||||
if (_format != audio::format_int16) {
|
||||
APPL_ERROR("call wrong type ... (need int16_t)");
|
||||
TEST_ERROR("call wrong type ... (need int16_t)");
|
||||
}
|
||||
m_buffer.read(_data, _nbChunk);
|
||||
}
|
||||
@ -90,17 +90,17 @@ namespace river_test_aec {
|
||||
uint32_t _frequency,
|
||||
const std::vector<audio::channel>& _map) {
|
||||
if (_format != audio::format_int16) {
|
||||
APPL_ERROR("call wrong type ... (need int16_t)");
|
||||
TEST_ERROR("call wrong type ... (need int16_t)");
|
||||
}
|
||||
m_buffer.write(_data, _nbChunk);
|
||||
}
|
||||
void start() {
|
||||
if(m_interfaceIn == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
if(m_interfaceOut == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
m_interfaceOut->start();
|
||||
@ -108,11 +108,11 @@ namespace river_test_aec {
|
||||
}
|
||||
void stop() {
|
||||
if(m_interfaceIn == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
if(m_interfaceOut == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
m_manager->generateDotAll("activeProcess.dot");
|
||||
|
@ -7,7 +7,7 @@
|
||||
#ifndef __RIVER_TEST_ECHO_DELAY_H__
|
||||
#define __RIVER_TEST_ECHO_DELAY_H__
|
||||
|
||||
#include <audio/river/debug.h>
|
||||
#include <test-debug/debug.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "test_echo_delay"
|
||||
@ -50,7 +50,7 @@ namespace river_test_echo_delay {
|
||||
audio::format_int16,
|
||||
"speaker");
|
||||
if(m_interfaceOut == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
@ -70,7 +70,7 @@ namespace river_test_echo_delay {
|
||||
audio::format_int16,
|
||||
"microphone");
|
||||
if(m_interfaceIn == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
@ -88,7 +88,7 @@ namespace river_test_echo_delay {
|
||||
audio::format_int16,
|
||||
"speaker");
|
||||
if(m_interfaceFB == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
@ -135,7 +135,7 @@ namespace river_test_echo_delay {
|
||||
m_nextSampleCount = m_delayBetweenEvent.count()*int64_t(_frequency)/1000;
|
||||
m_phase = -1;
|
||||
}
|
||||
//APPL_INFO("sample : " << m_nextSampleCount);
|
||||
//TEST_INFO("sample : " << m_nextSampleCount);
|
||||
for (int32_t iii=0; iii<_nbChunk; iii++) {
|
||||
if (m_nextSampleCount > 0) {
|
||||
m_nextSampleCount--;
|
||||
@ -157,7 +157,7 @@ namespace river_test_echo_delay {
|
||||
// start detection ...
|
||||
m_stateFB = 0;
|
||||
m_stateMic = 0;
|
||||
APPL_WARNING("Time Pulse zero crossing: " << m_currentTick << " id=" << iii);
|
||||
TEST_WARNING("Time Pulse zero crossing: " << m_currentTick << " id=" << iii);
|
||||
}
|
||||
m_phase = newPhase;
|
||||
if (m_phase >= 2*M_PI) {
|
||||
@ -182,7 +182,7 @@ namespace river_test_echo_delay {
|
||||
return _time + audio::Duration(0, int64_t(_pos+1)*1000000000LL/int64_t(_frequency));
|
||||
}
|
||||
double xxx = double(-_val1) / double(_val2 - _val1);
|
||||
APPL_VERBOSE("deltaPos:" << xxx);
|
||||
TEST_VERBOSE("deltaPos:" << xxx);
|
||||
return _time + audio::Duration(0, int64_t((double(_pos)+xxx)*1000000000.0)/int64_t(_frequency));
|
||||
}
|
||||
|
||||
@ -193,9 +193,9 @@ namespace river_test_echo_delay {
|
||||
uint32_t _frequency,
|
||||
const std::vector<audio::channel>& _map) {
|
||||
if (_format != audio::format_int16) {
|
||||
APPL_ERROR("call wrong type ... (need int16_t)");
|
||||
TEST_ERROR("call wrong type ... (need int16_t)");
|
||||
}
|
||||
RIVER_SAVE_FILE_MACRO(int16_t, "REC_FeedBack.raw", _data, _nbChunk*_map.size());
|
||||
TEST_SAVE_FILE_MACRO(int16_t, "REC_FeedBack.raw", _data, _nbChunk*_map.size());
|
||||
if (m_estimateVolumeInput == true) {
|
||||
// nothing to do ...
|
||||
} else {
|
||||
@ -207,10 +207,10 @@ namespace river_test_echo_delay {
|
||||
if (m_stateFB == 0) {
|
||||
if (data[iii*_map.size() + jjj] > INT16_MAX/5) {
|
||||
m_stateFB = 1;
|
||||
APPL_VERBOSE("FB: detect Normal " << iii);
|
||||
TEST_VERBOSE("FB: detect Normal " << iii);
|
||||
} else if (data[iii*_map.size() + jjj] < -INT16_MAX/5) {
|
||||
m_stateFB = 2;
|
||||
APPL_VERBOSE("FB: detect inverse " << iii);
|
||||
TEST_VERBOSE("FB: detect inverse " << iii);
|
||||
}
|
||||
} else if (m_stateFB == 1) {
|
||||
// normale phase
|
||||
@ -218,10 +218,10 @@ namespace river_test_echo_delay {
|
||||
// detect inversion of signe ...
|
||||
m_stateFB = 3;
|
||||
audio::Time time = getInterpolateTime(_time, iii-1, data[(iii-1)*_map.size() + jjj], data[iii*_map.size() + jjj], _frequency);
|
||||
APPL_VERBOSE("FB: 1 position -1: " << iii-1 << " " << data[(iii-1)*_map.size() + jjj]);
|
||||
APPL_VERBOSE("FB: 1 position 0: " << iii << " " << data[iii*_map.size() + jjj]);
|
||||
TEST_VERBOSE("FB: 1 position -1: " << iii-1 << " " << data[(iii-1)*_map.size() + jjj]);
|
||||
TEST_VERBOSE("FB: 1 position 0: " << iii << " " << data[iii*_map.size() + jjj]);
|
||||
|
||||
APPL_WARNING("FB: 1 time detected: " << time << " delay = " << float((time-m_currentTick).count())/1000.0f << "µs");
|
||||
TEST_WARNING("FB: 1 time detected: " << time << " delay = " << float((time-m_currentTick).count())/1000.0f << "µs");
|
||||
}
|
||||
} else if (m_stateFB == 2) {
|
||||
// inverse phase
|
||||
@ -229,9 +229,9 @@ namespace river_test_echo_delay {
|
||||
// detect inversion of signe ...
|
||||
m_stateFB = 3;
|
||||
audio::Time time = getInterpolateTime(_time, iii-1, data[(iii-1)*_map.size() + jjj], data[iii*_map.size() + jjj], _frequency);
|
||||
APPL_VERBOSE("FB: 2 position -1: " << iii-1 << " " << data[(iii-1)*_map.size() + jjj]);
|
||||
APPL_VERBOSE("FB: 2 position 0: " << iii << " " << data[iii*_map.size() + jjj]);
|
||||
APPL_WARNING("FB: 2 time detected: " << time << " delay = " << float((time-m_currentTick).count())/1000.0f << "µs");
|
||||
TEST_VERBOSE("FB: 2 position -1: " << iii-1 << " " << data[(iii-1)*_map.size() + jjj]);
|
||||
TEST_VERBOSE("FB: 2 position 0: " << iii << " " << data[iii*_map.size() + jjj]);
|
||||
TEST_WARNING("FB: 2 time detected: " << time << " delay = " << float((time-m_currentTick).count())/1000.0f << "µs");
|
||||
}
|
||||
} else if (m_stateFB == 3) {
|
||||
// TODO : Detect the pic ...
|
||||
@ -248,16 +248,16 @@ namespace river_test_echo_delay {
|
||||
uint32_t _frequency,
|
||||
const std::vector<audio::channel>& _map) {
|
||||
if (_format != audio::format_int16) {
|
||||
APPL_ERROR("call wrong type ... (need int16_t)");
|
||||
TEST_ERROR("call wrong type ... (need int16_t)");
|
||||
}
|
||||
RIVER_SAVE_FILE_MACRO(int16_t, "REC_Microphone.raw", _data, _nbChunk*_map.size());
|
||||
TEST_SAVE_FILE_MACRO(int16_t, "REC_Microphone.raw", _data, _nbChunk*_map.size());
|
||||
const int16_t* data = static_cast<const int16_t*>(_data);
|
||||
if (m_estimateVolumeInput == true) {
|
||||
m_stateMic ++;
|
||||
const int16_t* data = static_cast<const int16_t*>(_data);
|
||||
if (m_stateMic <= 40) {
|
||||
for (size_t iii=0; iii<_nbChunk*_map.size(); ++iii) {
|
||||
//APPL_INFO("value=" << data[iii]);
|
||||
//TEST_INFO("value=" << data[iii]);
|
||||
m_volumeInputMax = std::max(int16_t(data[iii]), m_volumeInputMax);
|
||||
m_volumeInputMin = std::min(int16_t(data[iii]), m_volumeInputMin);
|
||||
}
|
||||
@ -269,7 +269,7 @@ namespace river_test_echo_delay {
|
||||
int16_t valueMax = 0;
|
||||
int16_t valueMin = 0;
|
||||
for (size_t iii=0; iii<_nbChunk*_map.size(); ++iii) {
|
||||
//APPL_INFO("value=" << data[iii]);
|
||||
//TEST_INFO("value=" << data[iii]);
|
||||
valueMax = std::max(int16_t(data[iii]), valueMax);
|
||||
valueMin = std::min(int16_t(data[iii]), valueMin);
|
||||
}
|
||||
@ -284,7 +284,7 @@ namespace river_test_echo_delay {
|
||||
m_gain += 3.0f;
|
||||
m_gain = std::min(m_gain, 0.0f);
|
||||
m_interfaceOut->setParameter("volume", "FLOW", etk::to_string(m_gain) + "dB");
|
||||
APPL_INFO("Set detection volume : " << m_gain << " m_stateMic=" << m_stateMic);
|
||||
TEST_INFO("Set detection volume : " << m_gain << " m_stateMic=" << m_stateMic);
|
||||
m_stateMic = 3;
|
||||
m_phase = -1;
|
||||
m_estimateVolumeInput = false;
|
||||
@ -292,7 +292,7 @@ namespace river_test_echo_delay {
|
||||
} else {
|
||||
if (m_stateMic%2 == 0) {
|
||||
if (m_gain == 0.0f) {
|
||||
APPL_CRITICAL("Can not find the basicVolume ...");
|
||||
TEST_CRITICAL("Can not find the basicVolume ...");
|
||||
}
|
||||
// just update volume
|
||||
m_gain += 1.0f;
|
||||
@ -309,10 +309,10 @@ namespace river_test_echo_delay {
|
||||
if (m_stateMic == 0) {
|
||||
if (data[iii*_map.size() + jjj] > m_volumeInputMax) {
|
||||
m_stateMic = 1;
|
||||
APPL_VERBOSE("Mic: detect Normal " << iii);
|
||||
TEST_VERBOSE("Mic: detect Normal " << iii);
|
||||
} else if (data[iii*_map.size() + jjj] < m_volumeInputMin) {
|
||||
m_stateMic = 2;
|
||||
APPL_VERBOSE("Mic: detect inverse " << iii);
|
||||
TEST_VERBOSE("Mic: detect inverse " << iii);
|
||||
}
|
||||
} else if (m_stateMic == 1) {
|
||||
// normale phase
|
||||
@ -320,11 +320,11 @@ namespace river_test_echo_delay {
|
||||
// detect inversion of signe ...
|
||||
m_stateMic = 3;
|
||||
audio::Time time = getInterpolateTime(_time, iii-1, data[(iii-1)*_map.size() + jjj], data[iii*_map.size() + jjj], _frequency);
|
||||
APPL_VERBOSE("MIC: 1 position -1: " << iii-1 << " " << data[(iii-1)*_map.size() + jjj]);
|
||||
APPL_VERBOSE("MIC: 1 position 0: " << iii << " " << data[iii*_map.size() + jjj]);
|
||||
TEST_VERBOSE("MIC: 1 position -1: " << iii-1 << " " << data[(iii-1)*_map.size() + jjj]);
|
||||
TEST_VERBOSE("MIC: 1 position 0: " << iii << " " << data[iii*_map.size() + jjj]);
|
||||
audio::Duration delay = time-m_currentTick;
|
||||
int32_t sampleDalay = (delay.count()*_frequency)/1000000000LL;
|
||||
APPL_WARNING("MIC: 1 time detected: " << time << " delay = " << float(delay.count())/1000.0f << "µs samples=" << sampleDalay);
|
||||
TEST_WARNING("MIC: 1 time detected: " << time << " delay = " << float(delay.count())/1000.0f << "µs samples=" << sampleDalay);
|
||||
m_delayListMic.push_back(delay.count());
|
||||
}
|
||||
} else if (m_stateMic == 2) {
|
||||
@ -333,11 +333,11 @@ namespace river_test_echo_delay {
|
||||
// detect inversion of signe ...
|
||||
m_stateMic = 3;
|
||||
audio::Time time = getInterpolateTime(_time, iii-1, data[(iii-1)*_map.size() + jjj], data[iii*_map.size() + jjj], _frequency);
|
||||
APPL_VERBOSE("MIC: 2 position -1: " << iii-1 << " " << data[(iii-1)*_map.size() + jjj]);
|
||||
APPL_VERBOSE("MIC: 2 position 0: " << iii << " " << data[iii*_map.size() + jjj]);
|
||||
TEST_VERBOSE("MIC: 2 position -1: " << iii-1 << " " << data[(iii-1)*_map.size() + jjj]);
|
||||
TEST_VERBOSE("MIC: 2 position 0: " << iii << " " << data[iii*_map.size() + jjj]);
|
||||
audio::Duration delay = time-m_currentTick;
|
||||
int32_t sampleDalay = (delay.count()*_frequency)/1000000000LL;
|
||||
APPL_WARNING("MIC: 2 time detected: " << time << " delay = " << float(delay.count())/1000.0f << "µs samples=" << sampleDalay);
|
||||
TEST_WARNING("MIC: 2 time detected: " << time << " delay = " << float(delay.count())/1000.0f << "µs samples=" << sampleDalay);
|
||||
m_delayListMic.push_back(delay.count());
|
||||
}
|
||||
} else if (m_stateMic == 3) {
|
||||
@ -350,15 +350,15 @@ namespace river_test_echo_delay {
|
||||
}
|
||||
void run() {
|
||||
if(m_interfaceIn == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
if(m_interfaceOut == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
if(m_interfaceFB == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
m_interfaceOut->start();
|
||||
@ -380,7 +380,7 @@ namespace river_test_echo_delay {
|
||||
delayAverage /= m_delayListMic.size();
|
||||
}
|
||||
int32_t sampleDalay = (delayAverage*48000)/1000000000LL;
|
||||
APPL_ERROR("Average delay in ns : " << delayAverage << " nbSample=" << sampleDalay);
|
||||
TEST_ERROR("Average delay in ns : " << delayAverage << " nbSample=" << sampleDalay);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -58,7 +58,7 @@ namespace river_test_format {
|
||||
channelMap.push_back(audio::channel_rearLeft);
|
||||
channelMap.push_back(audio::channel_rearRight);
|
||||
} else {
|
||||
APPL_ERROR("Can not generate with channel != 1,2,4");
|
||||
TEST_ERROR("Can not generate with channel != 1,2,4");
|
||||
return;
|
||||
}
|
||||
m_interface = m_manager->createOutput(m_freq,
|
||||
@ -67,7 +67,7 @@ namespace river_test_format {
|
||||
"speaker",
|
||||
"WriteModeCallbackType");
|
||||
if(m_interface == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
@ -86,7 +86,7 @@ namespace river_test_format {
|
||||
enum audio::format _format,
|
||||
uint32_t _frequency,
|
||||
const std::vector<audio::channel>& _map) {
|
||||
//APPL_DEBUG("Get data ... " << _format << " map=" << _map << " chunk=" << _nbChunk);
|
||||
//TEST_DEBUG("Get data ... " << _format << " map=" << _map << " chunk=" << _nbChunk);
|
||||
double baseCycle = 2.0*M_PI/double(m_freq) * double(m_generateFreq);
|
||||
if (_format == audio::format_int16) {
|
||||
int16_t* data = static_cast<int16_t*>(_data);
|
||||
@ -136,7 +136,7 @@ namespace river_test_format {
|
||||
}
|
||||
void run() {
|
||||
if(m_interface == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
m_interface->start();
|
||||
@ -201,7 +201,7 @@ namespace river_test_format {
|
||||
audio::river::initString(configurationRiver);
|
||||
std11::shared_ptr<audio::river::Manager> manager;
|
||||
manager = audio::river::Manager::create("testApplication");
|
||||
APPL_INFO("test convert flaot to output (callback mode)");
|
||||
TEST_INFO("test convert flaot to output (callback mode)");
|
||||
std::vector<float> listFreq;
|
||||
listFreq.push_back(4000);
|
||||
listFreq.push_back(8000);
|
||||
@ -227,7 +227,7 @@ namespace river_test_format {
|
||||
for (size_t fff=0; fff<listFreq.size(); ++fff) {
|
||||
for (size_t ccc=0; ccc<listChannel.size(); ++ccc) {
|
||||
for (size_t iii=0; iii<listFormat.size(); ++iii) {
|
||||
APPL_INFO("freq=" << listFreq[fff] << " channel=" << listChannel[ccc] << " format=" << getFormatString(listFormat[iii]));
|
||||
TEST_INFO("freq=" << listFreq[fff] << " channel=" << listChannel[ccc] << " format=" << getFormatString(listFormat[iii]));
|
||||
std11::shared_ptr<testOutCallbackType> process = std11::make_shared<testOutCallbackType>(manager, listFreq[fff], listChannel[ccc], listFormat[iii]);
|
||||
process->run();
|
||||
process.reset();
|
||||
|
@ -7,7 +7,7 @@
|
||||
#ifndef __RIVER_TEST_MUXER_H__
|
||||
#define __RIVER_TEST_MUXER_H__
|
||||
|
||||
#include <audio/river/debug.h>
|
||||
#include <test-debug/debug.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "test_muxer"
|
||||
@ -31,7 +31,7 @@ namespace river_test_muxer {
|
||||
audio::format_int16,
|
||||
"speaker");
|
||||
if(m_interfaceOut == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
@ -52,7 +52,7 @@ namespace river_test_muxer {
|
||||
audio::format_int16,
|
||||
"microphone-muxed");
|
||||
if(m_interfaceIn == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
@ -92,18 +92,18 @@ namespace river_test_muxer {
|
||||
uint32_t _frequency,
|
||||
const std::vector<audio::channel>& _map) {
|
||||
if (_format != audio::format_int16) {
|
||||
APPL_ERROR("call wrong type ... (need int16_t)");
|
||||
TEST_ERROR("call wrong type ... (need int16_t)");
|
||||
}
|
||||
RIVER_SAVE_FILE_MACRO(int16_t, "REC_MicrophoneMuxed.raw", _data, _nbChunk*_map.size());
|
||||
APPL_ERROR("Receive data ... " << _nbChunk << " map=" << _map);
|
||||
TEST_SAVE_FILE_MACRO(int16_t, "REC_MicrophoneMuxed.raw", _data, _nbChunk*_map.size());
|
||||
TEST_ERROR("Receive data ... " << _nbChunk << " map=" << _map);
|
||||
}
|
||||
void run() {
|
||||
if(m_interfaceIn == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
if(m_interfaceOut == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
m_interfaceOut->start();
|
||||
|
@ -30,7 +30,7 @@ namespace river_test_playback_callback {
|
||||
audio::format_int16,
|
||||
_io);
|
||||
if(m_interface == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
@ -50,7 +50,7 @@ namespace river_test_playback_callback {
|
||||
uint32_t _frequency,
|
||||
const std::vector<audio::channel>& _map) {
|
||||
if (_format != audio::format_int16) {
|
||||
APPL_ERROR("call wrong type ... (need int16_t)");
|
||||
TEST_ERROR("call wrong type ... (need int16_t)");
|
||||
}
|
||||
int16_t* data = static_cast<int16_t*>(_data);
|
||||
double baseCycle = 2.0*M_PI/(double)48000 * (double)550;
|
||||
@ -66,7 +66,7 @@ namespace river_test_playback_callback {
|
||||
}
|
||||
void run() {
|
||||
if(m_interface == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
m_interface->start();
|
||||
@ -97,7 +97,7 @@ namespace river_test_playback_callback {
|
||||
std11::shared_ptr<audio::river::Manager> manager;
|
||||
manager = audio::river::Manager::create("testApplication");
|
||||
|
||||
APPL_INFO("test output (callback mode)");
|
||||
TEST_INFO("test output (callback mode)");
|
||||
std11::shared_ptr<testOutCallback> process = std11::make_shared<testOutCallback>(manager, "speaker");
|
||||
ASSERT_NE(process, nullptr);
|
||||
process->run();
|
||||
@ -111,7 +111,7 @@ namespace river_test_playback_callback {
|
||||
std11::shared_ptr<audio::river::Manager> manager;
|
||||
manager = audio::river::Manager::create("testApplication");
|
||||
|
||||
APPL_INFO("test output (callback mode)");
|
||||
TEST_INFO("test output (callback mode)");
|
||||
std11::shared_ptr<testOutCallback> process = std11::make_shared<testOutCallback>(manager, "speaker-pulse");
|
||||
process->run();
|
||||
process.reset();
|
||||
@ -124,7 +124,7 @@ namespace river_test_playback_callback {
|
||||
std11::shared_ptr<audio::river::Manager> manager;
|
||||
manager = audio::river::Manager::create("testApplication");
|
||||
|
||||
APPL_INFO("test output (callback mode)");
|
||||
TEST_INFO("test output (callback mode)");
|
||||
std11::shared_ptr<testOutCallback> process = std11::make_shared<testOutCallback>(manager, "speaker-jack");
|
||||
process->run();
|
||||
process.reset();
|
||||
|
@ -43,14 +43,14 @@ namespace river_test_playback_write {
|
||||
audio::format_int16,
|
||||
"speaker");
|
||||
if(m_interface == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
m_interface->setReadwrite();
|
||||
}
|
||||
void run() {
|
||||
if(m_interface == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
double phase=0;
|
||||
@ -94,7 +94,7 @@ namespace river_test_playback_write {
|
||||
std11::shared_ptr<audio::river::Manager> manager;
|
||||
manager = audio::river::Manager::create("testApplication");
|
||||
|
||||
APPL_INFO("test output (write mode)");
|
||||
TEST_INFO("test output (write mode)");
|
||||
std11::shared_ptr<testOutWrite> process = std11::make_shared<testOutWrite>(manager);
|
||||
process->run();
|
||||
process.reset();
|
||||
@ -120,7 +120,7 @@ namespace river_test_playback_write {
|
||||
audio::format_int16,
|
||||
"speaker");
|
||||
if(m_interface == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
m_interface->setReadwrite();
|
||||
@ -138,7 +138,7 @@ namespace river_test_playback_write {
|
||||
uint32_t _frequency,
|
||||
const std::vector<audio::channel>& _map) {
|
||||
if (_format != audio::format_int16) {
|
||||
APPL_ERROR("call wrong type ... (need int16_t)");
|
||||
TEST_ERROR("call wrong type ... (need int16_t)");
|
||||
}
|
||||
std::vector<int16_t> data;
|
||||
data.resize(1024*_map.size());
|
||||
@ -157,7 +157,7 @@ namespace river_test_playback_write {
|
||||
}
|
||||
void run() {
|
||||
if(m_interface == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
m_interface->start();
|
||||
@ -171,7 +171,7 @@ namespace river_test_playback_write {
|
||||
std11::shared_ptr<audio::river::Manager> manager;
|
||||
manager = audio::river::Manager::create("testApplication");
|
||||
|
||||
APPL_INFO("test output (write with callback event mode)");
|
||||
TEST_INFO("test output (write with callback event mode)");
|
||||
std11::shared_ptr<testOutWriteCallback> process = std11::make_shared<testOutWriteCallback>(manager);
|
||||
process->run();
|
||||
process.reset();
|
||||
|
@ -7,7 +7,7 @@
|
||||
#ifndef __RIVER_TEST_RECORD_CALLBACK_H__
|
||||
#define __RIVER_TEST_RECORD_CALLBACK_H__
|
||||
|
||||
#include <audio/river/debug.h>
|
||||
#include <test-debug/debug.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "test_record_callback"
|
||||
@ -42,7 +42,7 @@ namespace river_test_record_callback {
|
||||
audio::format_int16,
|
||||
_input);
|
||||
if(m_interface == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
@ -62,20 +62,20 @@ namespace river_test_record_callback {
|
||||
uint32_t _frequency,
|
||||
const std::vector<audio::channel>& _map) {
|
||||
if (_format != audio::format_int16) {
|
||||
APPL_ERROR("call wrong type ... (need int16_t)");
|
||||
TEST_ERROR("call wrong type ... (need int16_t)");
|
||||
}
|
||||
RIVER_SAVE_FILE_MACRO(int16_t, "REC_INPUT.raw", _data, _nbChunk * _map.size());
|
||||
TEST_SAVE_FILE_MACRO(int16_t, "REC_INPUT.raw", _data, _nbChunk * _map.size());
|
||||
const int16_t* data = static_cast<const int16_t*>(_data);
|
||||
int64_t value = 0;
|
||||
for (size_t iii=0; iii<_nbChunk*_map.size(); ++iii) {
|
||||
value += std::abs(data[iii]);
|
||||
}
|
||||
value /= (_nbChunk*_map.size());
|
||||
APPL_INFO("Get data ... average=" << int32_t(value));
|
||||
TEST_INFO("Get data ... average=" << int32_t(value));
|
||||
}
|
||||
void run() {
|
||||
if(m_interface == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
m_interface->start();
|
||||
@ -89,7 +89,7 @@ namespace river_test_record_callback {
|
||||
audio::river::initString(configurationRiver);
|
||||
std11::shared_ptr<audio::river::Manager> manager;
|
||||
manager = audio::river::Manager::create("testApplication");
|
||||
APPL_INFO("test input (callback mode)");
|
||||
TEST_INFO("test input (callback mode)");
|
||||
std11::shared_ptr<testInCallback> process = std11::make_shared<testInCallback>(manager);
|
||||
process->run();
|
||||
process.reset();
|
||||
|
@ -45,7 +45,7 @@ namespace river_test_volume {
|
||||
audio::format_int16,
|
||||
"speaker");
|
||||
if(m_interface == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
@ -80,43 +80,43 @@ namespace river_test_volume {
|
||||
}
|
||||
void run() {
|
||||
if(m_interface == nullptr) {
|
||||
APPL_ERROR("nullptr interface");
|
||||
TEST_ERROR("nullptr interface");
|
||||
return;
|
||||
}
|
||||
m_interface->start();
|
||||
usleep(1000000);
|
||||
m_interface->setParameter("volume", "FLOW", "-3dB");
|
||||
APPL_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
usleep(500000);
|
||||
m_interface->setParameter("volume", "FLOW", "-6dB");
|
||||
APPL_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
usleep(500000);
|
||||
m_interface->setParameter("volume", "FLOW", "-9dB");
|
||||
APPL_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
usleep(500000);
|
||||
m_interface->setParameter("volume", "FLOW", "-12dB");
|
||||
APPL_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
usleep(500000);
|
||||
m_interface->setParameter("volume", "FLOW", "-3dB");
|
||||
APPL_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
usleep(500000);
|
||||
m_interface->setParameter("volume", "FLOW", "3dB");
|
||||
APPL_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
usleep(500000);
|
||||
m_interface->setParameter("volume", "FLOW", "6dB");
|
||||
APPL_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
usleep(500000);
|
||||
m_interface->setParameter("volume", "FLOW", "9dB");
|
||||
APPL_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
usleep(500000);
|
||||
m_interface->setParameter("volume", "FLOW", "0dB");
|
||||
APPL_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
usleep(500000);
|
||||
m_manager->setVolume("MASTER", -3.0f);
|
||||
APPL_INFO("get volume MASTER: " << m_manager->getVolume("MASTER") );
|
||||
TEST_INFO("get volume MASTER: " << m_manager->getVolume("MASTER") );
|
||||
usleep(500000);
|
||||
m_manager->setVolume("MEDIA", -3.0f);
|
||||
APPL_INFO("get volume MEDIA: " << m_manager->getVolume("MEDIA") );
|
||||
TEST_INFO("get volume MEDIA: " << m_manager->getVolume("MEDIA") );
|
||||
usleep(1000000);
|
||||
m_interface->stop();
|
||||
}
|
||||
|
@ -7,7 +7,6 @@
|
||||
#ifndef __ARW_TEMPORAL_VIEWER_H__
|
||||
#define __ARW_TEMPORAL_VIEWER_H__
|
||||
|
||||
#include <audio/river/widget/debug.h>
|
||||
#include <ewol/widget/Widget.h>
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <audio/river/river.h>
|
||||
|
@ -4,20 +4,39 @@ import lutin.tools as tools
|
||||
import lutin.debug as debug
|
||||
import os
|
||||
|
||||
|
||||
def get_type():
|
||||
return "LIBRARY"
|
||||
|
||||
def get_desc():
|
||||
return "audio specific widget"
|
||||
|
||||
def get_license():
|
||||
return "APACHE v2.0"
|
||||
def get_licence():
|
||||
return "APACHE-2"
|
||||
|
||||
def create(target):
|
||||
my_module = module.Module(__file__, 'audio-river-widget', 'LIBRARY')
|
||||
def get_compagny_type():
|
||||
return "com"
|
||||
|
||||
def get_compagny_name():
|
||||
return "atria-soft"
|
||||
|
||||
def get_maintainer():
|
||||
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
||||
|
||||
def get_version():
|
||||
return [0,0,0]
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
my_module.add_src_file([
|
||||
'audio/river/widget/TemporalViewer.cpp',
|
||||
'audio/river/widget/debug.cpp'
|
||||
])
|
||||
my_module.add_header_file([
|
||||
'audio/river/widget/TemporalViewer.h'
|
||||
])
|
||||
my_module.add_module_depend(['ewol', 'audio-river'])
|
||||
my_module.add_export_path(tools.get_current_path(__file__))
|
||||
my_module.add_path(tools.get_current_path(__file__))
|
||||
return my_module
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user