[DEV] update new ETK
This commit is contained in:
@@ -33,8 +33,9 @@
|
||||
#include <etest/etest.hpp>
|
||||
#include <etk/etk.hpp>
|
||||
#include <etk/os/FSNode.hpp>
|
||||
#include <cmath>
|
||||
#include <sstream>
|
||||
extern "C" {
|
||||
#include <math.h>
|
||||
}
|
||||
|
||||
#include <ethread/Thread.hpp>
|
||||
#include "testAEC.hpp"
|
||||
|
@@ -26,7 +26,7 @@ namespace river_test_aec {
|
||||
channelMap.pushBack(audio::channel_frontLeft);
|
||||
channelMap.pushBack(audio::channel_frontRight);
|
||||
}
|
||||
m_buffer.setCapacity(std::chrono::milliseconds(2000), sizeof(int16_t)*channelMap.size(), 48000);
|
||||
m_buffer.setCapacity(echrono::milliseconds(2000), sizeof(int16_t)*channelMap.size(), 48000);
|
||||
|
||||
m_interfaceOut = m_manager->createOutput(48000,
|
||||
channelMap,
|
||||
@@ -37,14 +37,14 @@ namespace river_test_aec {
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
m_interfaceOut->setOutputCallback(std::bind(&Linker::onDataNeeded,
|
||||
this,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2,
|
||||
std::placeholders::_3,
|
||||
std::placeholders::_4,
|
||||
std::placeholders::_5,
|
||||
std::placeholders::_6));
|
||||
m_interfaceOut->setOutputCallback([=](void* _data,
|
||||
const audio::Time& _time,
|
||||
size_t _nbChunk,
|
||||
enum audio::format _format,
|
||||
uint32_t _frequency,
|
||||
const etk::Vector<audio::channel>& _map) {
|
||||
onDataNeeded(_data, _time, _nbChunk, _format, _frequency, _map);
|
||||
});
|
||||
m_interfaceOut->addVolumeGroup("FLOW");
|
||||
if ("speaker" == _output) {
|
||||
m_interfaceOut->setParameter("volume", "FLOW", "0dB");
|
||||
@@ -59,14 +59,14 @@ namespace river_test_aec {
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
m_interfaceIn->setInputCallback(std::bind(&Linker::onDataReceived,
|
||||
this,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2,
|
||||
std::placeholders::_3,
|
||||
std::placeholders::_4,
|
||||
std::placeholders::_5,
|
||||
std::placeholders::_6));
|
||||
m_interfaceIn->setInputCallback([=](const void* _data,
|
||||
const audio::Time& _time,
|
||||
size_t _nbChunk,
|
||||
enum audio::format _format,
|
||||
uint32_t _frequency,
|
||||
const etk::Vector<audio::channel>& _map) {
|
||||
onDataReceived(_data, _time, _nbChunk, _format, _frequency, _map);
|
||||
});
|
||||
|
||||
}
|
||||
void onDataNeeded(void* _data,
|
||||
@@ -203,7 +203,7 @@ namespace river_test_aec {
|
||||
ememory::SharedPtr<Linker> processLink2 = ememory::makeShared<Linker>(manager, "microphone", "speaker-test");
|
||||
processLink1->start();
|
||||
processLink2->start();
|
||||
ethread::sleepMilliSeconds(std::chrono::seconds(20));
|
||||
ethread::sleepMilliSeconds(1000*(20));
|
||||
processLink1->stop();
|
||||
processLink2->stop();
|
||||
|
||||
|
@@ -17,7 +17,7 @@ namespace river_test_echo_delay {
|
||||
double m_phase;
|
||||
double m_freq;
|
||||
int32_t m_nextSampleCount;
|
||||
std::chrono::milliseconds m_delayBetweenEvent;
|
||||
echrono::milliseconds m_delayBetweenEvent;
|
||||
audio::Time m_nextTick;
|
||||
audio::Time m_currentTick;
|
||||
int32_t m_stateFB;
|
||||
@@ -49,14 +49,14 @@ namespace river_test_echo_delay {
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
m_interfaceOut->setOutputCallback(std::bind(&TestClass::onDataNeeded,
|
||||
this,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2,
|
||||
std::placeholders::_3,
|
||||
std::placeholders::_4,
|
||||
std::placeholders::_5,
|
||||
std::placeholders::_6));
|
||||
m_interfaceOut->setOutputCallback([=](const void* _data,
|
||||
const audio::Time& _time,
|
||||
size_t _nbChunk,
|
||||
enum audio::format _format,
|
||||
uint32_t _frequency,
|
||||
const etk::Vector<audio::channel>& _map) {
|
||||
onDataNeeded(_data, _time, _nbChunk, _format, _frequency, _map);
|
||||
});
|
||||
m_interfaceOut->addVolumeGroup("FLOW");
|
||||
m_interfaceOut->setParameter("volume", "FLOW", etk::toString(m_gain) + "dB");
|
||||
|
||||
@@ -69,14 +69,14 @@ namespace river_test_echo_delay {
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
m_interfaceIn->setInputCallback(std::bind(&TestClass::onDataReceived,
|
||||
this,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2,
|
||||
std::placeholders::_3,
|
||||
std::placeholders::_4,
|
||||
std::placeholders::_5,
|
||||
std::placeholders::_6));
|
||||
m_interfaceIn->setInputCallback([=](const void* _data,
|
||||
const audio::Time& _time,
|
||||
size_t _nbChunk,
|
||||
enum audio::format _format,
|
||||
uint32_t _frequency,
|
||||
const etk::Vector<audio::channel>& _map) {
|
||||
onDataReceived(_data, _time, _nbChunk, _format, _frequency, _map);
|
||||
});
|
||||
|
||||
m_interfaceFB = m_manager->createFeedback(48000,
|
||||
channelMap,
|
||||
@@ -87,14 +87,14 @@ namespace river_test_echo_delay {
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
m_interfaceFB->setInputCallback(std::bind(&TestClass::onDataReceivedFeedBack,
|
||||
this,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2,
|
||||
std::placeholders::_3,
|
||||
std::placeholders::_4,
|
||||
std::placeholders::_5,
|
||||
std::placeholders::_6));
|
||||
m_interfaceFB->setInputCallback([=](const void* _data,
|
||||
const audio::Time& _time,
|
||||
size_t _nbChunk,
|
||||
enum audio::format _format,
|
||||
uint32_t _frequency,
|
||||
const etk::Vector<audio::channel>& _map) {
|
||||
onDataReceivedFeedBack(_data, _time, _nbChunk, _format, _frequency, _map);
|
||||
});
|
||||
|
||||
m_manager->generateDotAll("activeProcess.dot");
|
||||
}
|
||||
@@ -362,7 +362,7 @@ namespace river_test_echo_delay {
|
||||
while (m_estimateVolumeInput == true) {
|
||||
ethread::sleepMilliSeconds((10));
|
||||
}
|
||||
ethread::sleepMilliSeconds(std::chrono::seconds(10));
|
||||
ethread::sleepMilliSeconds(1000*(10));
|
||||
//m_interfaceFB->stop();
|
||||
m_interfaceIn->stop();
|
||||
m_interfaceOut->stop();
|
||||
|
@@ -66,14 +66,14 @@ namespace river_test_format {
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
m_interface->setOutputCallback(std::bind(&testOutCallbackType::onDataNeeded,
|
||||
this,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2,
|
||||
std::placeholders::_3,
|
||||
std::placeholders::_4,
|
||||
std::placeholders::_5,
|
||||
std::placeholders::_6));
|
||||
m_interface->setOutputCallback([=](const void* _data,
|
||||
const audio::Time& _time,
|
||||
size_t _nbChunk,
|
||||
enum audio::format _format,
|
||||
uint32_t _frequency,
|
||||
const etk::Vector<audio::channel>& _map) {
|
||||
onDataNeeded(_data, _time, _nbChunk, _format, _frequency, _map);
|
||||
});
|
||||
}
|
||||
void onDataNeeded(void* _data,
|
||||
const audio::Time& _time,
|
||||
@@ -136,7 +136,7 @@ namespace river_test_format {
|
||||
}
|
||||
m_interface->start();
|
||||
// wait 2 second ...
|
||||
ethread::sleepMilliSeconds(std::chrono::seconds(1));
|
||||
ethread::sleepMilliSeconds(1000*(1));
|
||||
m_interface->stop();
|
||||
ethread::sleepMilliSeconds((100));
|
||||
}
|
||||
|
@@ -30,14 +30,14 @@ namespace river_test_muxer {
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
m_interfaceOut->setOutputCallback(std::bind(&TestClass::onDataNeeded,
|
||||
this,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2,
|
||||
std::placeholders::_3,
|
||||
std::placeholders::_4,
|
||||
std::placeholders::_5,
|
||||
std::placeholders::_6));
|
||||
m_interfaceOut->setOutputCallback([=](const void* _data,
|
||||
const audio::Time& _time,
|
||||
size_t _nbChunk,
|
||||
enum audio::format _format,
|
||||
uint32_t _frequency,
|
||||
const etk::Vector<audio::channel>& _map) {
|
||||
onDataNeeded(_data, _time, _nbChunk, _format, _frequency, _map);
|
||||
});
|
||||
m_interfaceOut->addVolumeGroup("FLOW");
|
||||
//m_interfaceOut->setParameter("volume", "FLOW", "-6dB");
|
||||
|
||||
@@ -51,14 +51,14 @@ namespace river_test_muxer {
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
m_interfaceIn->setInputCallback(std::bind(&TestClass::onDataReceived,
|
||||
this,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2,
|
||||
std::placeholders::_3,
|
||||
std::placeholders::_4,
|
||||
std::placeholders::_5,
|
||||
std::placeholders::_6));
|
||||
m_interfaceIn->setInputCallback([=](const void* _data,
|
||||
const audio::Time& _time,
|
||||
size_t _nbChunk,
|
||||
enum audio::format _format,
|
||||
uint32_t _frequency,
|
||||
const etk::Vector<audio::channel>& _map) {
|
||||
onDataReceived(_data, _time, _nbChunk, _format, _frequency, _map);
|
||||
});
|
||||
m_manager->generateDotAll("activeProcess.dot");
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace river_test_muxer {
|
||||
}
|
||||
m_interfaceOut->start();
|
||||
m_interfaceIn->start();
|
||||
ethread::sleepMilliSeconds(std::chrono::seconds(10));
|
||||
ethread::sleepMilliSeconds(1000*(10));
|
||||
m_interfaceIn->stop();
|
||||
m_interfaceOut->stop();
|
||||
}
|
||||
|
@@ -29,14 +29,14 @@ namespace river_test_playback_callback {
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
m_interface->setOutputCallback(std::bind(&testOutCallback::onDataNeeded,
|
||||
this,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2,
|
||||
std::placeholders::_3,
|
||||
std::placeholders::_4,
|
||||
std::placeholders::_5,
|
||||
std::placeholders::_6));
|
||||
m_interface->setOutputCallback([=](const void* _data,
|
||||
const audio::Time& _time,
|
||||
size_t _nbChunk,
|
||||
enum audio::format _format,
|
||||
uint32_t _frequency,
|
||||
const etk::Vector<audio::channel>& _map) {
|
||||
onDataNeeded(_data, _time, _nbChunk, _format, _frequency, _map);
|
||||
});
|
||||
}
|
||||
void onDataNeeded(void* _data,
|
||||
const audio::Time& _time,
|
||||
@@ -66,7 +66,7 @@ namespace river_test_playback_callback {
|
||||
}
|
||||
m_interface->start();
|
||||
// wait 2 second ...
|
||||
ethread::sleepMilliSeconds(std::chrono::seconds(2));
|
||||
ethread::sleepMilliSeconds(1000*(2));
|
||||
m_interface->stop();
|
||||
}
|
||||
};
|
||||
|
@@ -119,13 +119,13 @@ namespace river_test_playback_write {
|
||||
return;
|
||||
}
|
||||
m_interface->setReadwrite();
|
||||
m_interface->setWriteCallback(std::bind(&testOutWriteCallback::onDataNeeded,
|
||||
this,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2,
|
||||
std::placeholders::_3,
|
||||
std::placeholders::_4,
|
||||
std::placeholders::_5));
|
||||
m_interface->setWriteCallback([=](const audio::Time& _time,
|
||||
size_t _nbChunk,
|
||||
enum audio::format _format,
|
||||
uint32_t _frequency,
|
||||
const etk::Vector<audio::channel>& _map) {
|
||||
onDataNeeded(_time, _nbChunk, _format, _frequency, _map);
|
||||
});
|
||||
}
|
||||
void onDataNeeded(const audio::Time& _time,
|
||||
size_t _nbChunk,
|
||||
@@ -156,7 +156,7 @@ namespace river_test_playback_write {
|
||||
return;
|
||||
}
|
||||
m_interface->start();
|
||||
ethread::sleepMilliSeconds(std::chrono::seconds(1));
|
||||
ethread::sleepMilliSeconds(1000*(1));
|
||||
m_interface->stop();
|
||||
}
|
||||
};
|
||||
|
@@ -41,14 +41,14 @@ namespace river_test_record_callback {
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
m_interface->setInputCallback(std::bind(&testInCallback::onDataReceived,
|
||||
this,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2,
|
||||
std::placeholders::_3,
|
||||
std::placeholders::_4,
|
||||
std::placeholders::_5,
|
||||
std::placeholders::_6));
|
||||
m_interface->setInputCallback([=](const void* _data,
|
||||
const audio::Time& _time,
|
||||
size_t _nbChunk,
|
||||
enum audio::format _format,
|
||||
uint32_t _frequency,
|
||||
const etk::Vector<audio::channel>& _map) {
|
||||
onDataReceived(_data, _time, _nbChunk, _format, _frequency, _map);
|
||||
});
|
||||
}
|
||||
void onDataReceived(const void* _data,
|
||||
const audio::Time& _time,
|
||||
@@ -75,7 +75,7 @@ namespace river_test_record_callback {
|
||||
}
|
||||
m_interface->start();
|
||||
// wait 2 second ...
|
||||
ethread::sleepMilliSeconds(std::chrono::seconds(20));
|
||||
ethread::sleepMilliSeconds(1000*(20));
|
||||
m_interface->stop();
|
||||
}
|
||||
};
|
||||
|
@@ -44,14 +44,14 @@ namespace river_test_volume {
|
||||
return;
|
||||
}
|
||||
// set callback mode ...
|
||||
m_interface->setOutputCallback(std::bind(&testCallbackVolume::onDataNeeded,
|
||||
this,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2,
|
||||
std::placeholders::_3,
|
||||
std::placeholders::_4,
|
||||
std::placeholders::_5,
|
||||
std::placeholders::_6));
|
||||
m_interface->setOutputCallback([=](const void* _data,
|
||||
const audio::Time& _time,
|
||||
size_t _nbChunk,
|
||||
enum audio::format _format,
|
||||
uint32_t _frequency,
|
||||
const etk::Vector<audio::channel>& _map) {
|
||||
onDataNeeded(_data, _time, _nbChunk, _format, _frequency, _map);
|
||||
});
|
||||
m_interface->addVolumeGroup("MEDIA");
|
||||
m_interface->addVolumeGroup("FLOW");
|
||||
}
|
||||
@@ -79,7 +79,7 @@ namespace river_test_volume {
|
||||
return;
|
||||
}
|
||||
m_interface->start();
|
||||
ethread::sleepMilliSeconds(std::chrono::seconds(1));
|
||||
ethread::sleepMilliSeconds(1000*(1));
|
||||
m_interface->setParameter("volume", "FLOW", "-3dB");
|
||||
TEST_INFO(" get volume : " << m_interface->getParameter("volume", "FLOW") );
|
||||
ethread::sleepMilliSeconds((500));
|
||||
@@ -112,7 +112,7 @@ namespace river_test_volume {
|
||||
ethread::sleepMilliSeconds((500));
|
||||
m_manager->setVolume("MEDIA", -3.0f);
|
||||
TEST_INFO("get volume MEDIA: " << m_manager->getVolume("MEDIA") );
|
||||
ethread::sleepMilliSeconds(std::chrono::seconds(1));
|
||||
ethread::sleepMilliSeconds(1000*(1));
|
||||
m_interface->stop();
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user