Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
a490cd2d85 | |||
3a4982d788 |
@ -4,7 +4,8 @@
|
||||
map-on:{
|
||||
interface:"alsa",
|
||||
#name:"default",
|
||||
name:"hw:0,0",
|
||||
#name:"hw:0,0",
|
||||
name:"default",
|
||||
timestamp-mode:"trigered",
|
||||
},
|
||||
group:"baseIOSynchrone",
|
||||
@ -131,4 +132,4 @@
|
||||
type:"int16",
|
||||
mux-demux-type:"int16",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
107
data/hardwareNao.json
Normal file
107
data/hardwareNao.json
Normal file
@ -0,0 +1,107 @@
|
||||
{
|
||||
speaker:{
|
||||
io:"output",
|
||||
map-on:{
|
||||
interface:"alsa",
|
||||
name:"hw:0,0",
|
||||
#name:"default",
|
||||
timestamp-mode:"trigered",
|
||||
},
|
||||
#group:"baseIOSynchrone",
|
||||
frequency:48000,
|
||||
channel-map:[
|
||||
"front-left", "front-right",
|
||||
],
|
||||
type:"int16",
|
||||
nb-chunk:6000,
|
||||
#volume-name:"MASTER",
|
||||
mux-demux-type:"int16-on-int32",
|
||||
},
|
||||
microphone-front:{
|
||||
io:"input",
|
||||
map-on:{
|
||||
interface:"alsa",
|
||||
#name:"hw:0,0,0",
|
||||
name:"AD1989A_inputs",
|
||||
#name:"default",
|
||||
timestamp-mode:"trigered",
|
||||
},
|
||||
#group:"baseIOSynchrone",
|
||||
frequency:48000,
|
||||
channel-map:[
|
||||
"front-left", "front-right"
|
||||
, "rear-left", "rear-right"
|
||||
],
|
||||
type:"int16",
|
||||
nb-chunk:6000, #16384,
|
||||
mux-demux-type:"int16",
|
||||
},
|
||||
microphone-rear:{
|
||||
io:"input",
|
||||
map-on:{
|
||||
interface:"alsa",
|
||||
name:"hw:0,0,1",
|
||||
timestamp-mode:"trigered",
|
||||
},
|
||||
#group:"baseIOSynchrone",
|
||||
frequency:48000,
|
||||
channel-map:[
|
||||
"rear-left", "rear-right"
|
||||
],
|
||||
type:"int16",
|
||||
nb-chunk:1024,
|
||||
mux-demux-type:"int16",
|
||||
},
|
||||
# virtual Nodes :
|
||||
microphone-clean:{
|
||||
io:"aec",
|
||||
# connect in input mode
|
||||
map-on-microphone:{
|
||||
# generic virtual definition
|
||||
io:"input",
|
||||
map-on:"microphone-muxed",
|
||||
resampling-type:"speexdsp",
|
||||
resampling-option:"quality=10"
|
||||
},
|
||||
# connect in feedback mode
|
||||
map-on-feedback:{
|
||||
io:"feedback",
|
||||
map-on:"speaker",
|
||||
resampling-type:"speexdsp",
|
||||
resampling-option:"quality=10",
|
||||
},
|
||||
#classical format configuration:
|
||||
frequency:16000,
|
||||
channel-map:[
|
||||
"front-left", "front-right", "rear-left", "rear-right"
|
||||
],
|
||||
type:"int16",
|
||||
# AEC algo definition
|
||||
algo:"river-remover",
|
||||
algo-mode:"cutter",
|
||||
feedback-delay:10000, # in nanosecond
|
||||
mux-demux-type:"int16",
|
||||
},
|
||||
microphone-muxed:{
|
||||
io:"muxer",
|
||||
map-on-input-1:{
|
||||
# generic virtual definition
|
||||
io:"input",
|
||||
map-on:"microphone-front",
|
||||
resampling-type:"speexdsp",
|
||||
resampling-option:"quality=10"
|
||||
},
|
||||
map-on-input-2:{
|
||||
io:"input",
|
||||
map-on:"microphone-rear",
|
||||
resampling-type:"speexdsp",
|
||||
resampling-option:"quality=10",
|
||||
},
|
||||
frequency:48000,
|
||||
channel-map:[
|
||||
"front-left", "front-right", "rear-left", "rear-right"
|
||||
],
|
||||
type:"int16",
|
||||
mux-demux-type:"int16",
|
||||
},
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
# input or output
|
||||
io:"input",
|
||||
# name of the harware device
|
||||
map-on:"microphone",
|
||||
map-on:"microphone-front",
|
||||
# name of the resampler
|
||||
resampling-type:"speexdsp",
|
||||
# some option to the resampler
|
||||
@ -35,4 +35,4 @@
|
||||
resampling-type:"speexdsp",
|
||||
resampling-option:"quality=10"
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,8 @@ def create(target):
|
||||
if target.name=="Windows":
|
||||
myModule.copy_file('data/hardwareWindows.json', 'hardware.json')
|
||||
elif target.name=="Linux":
|
||||
myModule.copy_file('data/hardwareLinux.json', 'hardware.json')
|
||||
#myModule.copy_file('data/hardwareLinux.json', 'hardware.json')
|
||||
myModule.copy_file('data/hardwareNao.json', 'hardware.json')
|
||||
elif target.name=="MacOs":
|
||||
myModule.copy_file('data/hardwareMacOs.json', 'hardware.json')
|
||||
elif target.name=="IOs":
|
||||
|
@ -198,6 +198,7 @@ void river::io::NodeMuxer::onDataReceivedInput1(const void* _data,
|
||||
if (_format != audio::format_int16) {
|
||||
RIVER_ERROR("call wrong type ... (need int16_t)");
|
||||
}
|
||||
RIVER_SAVE_FILE_MACRO(int16_t, "REC_input1.raw", _data, _nbChunk*_map.size());
|
||||
// push data synchronize
|
||||
std11::unique_lock<std11::mutex> lock(m_mutex);
|
||||
m_bufferInput1.write(_data, _nbChunk, _time);
|
||||
@ -216,6 +217,7 @@ void river::io::NodeMuxer::onDataReceivedInput2(const void* _data,
|
||||
if (_format != audio::format_int16) {
|
||||
RIVER_ERROR("call wrong type ... (need int16_t)");
|
||||
}
|
||||
RIVER_SAVE_FILE_MACRO(int16_t, "REC_input2.raw", _data, _nbChunk*_map.size());
|
||||
// push data synchronize
|
||||
std11::unique_lock<std11::mutex> lock(m_mutex);
|
||||
m_bufferInput2.write(_data, _nbChunk, _time);
|
||||
@ -480,4 +482,4 @@ void river::io::NodeMuxer::generateDot(etk::FSNode& _node) {
|
||||
}
|
||||
}
|
||||
_node << "\n";
|
||||
}
|
||||
}
|
||||
|
@ -45,8 +45,6 @@ namespace river_test_echo_delay {
|
||||
m_gain(-40) {
|
||||
//Set stereo output:
|
||||
std::vector<audio::channel> channelMap;
|
||||
channelMap.push_back(audio::channel_frontLeft);
|
||||
channelMap.push_back(audio::channel_frontRight);
|
||||
m_interfaceOut = m_manager->createOutput(48000,
|
||||
channelMap,
|
||||
audio::format_int16,
|
||||
@ -345,6 +343,9 @@ namespace river_test_echo_delay {
|
||||
m_interfaceOut->start();
|
||||
m_interfaceIn->start();
|
||||
//m_interfaceFB->start();
|
||||
while (m_estimateVolumeInput == true) {
|
||||
usleep(10000);
|
||||
}
|
||||
usleep(10000000);
|
||||
//m_interfaceFB->stop();
|
||||
m_interfaceIn->stop();
|
||||
|
@ -41,7 +41,7 @@ namespace river_test_muxer {
|
||||
std11::placeholders::_5,
|
||||
std11::placeholders::_6));
|
||||
m_interfaceOut->addVolumeGroup("FLOW");
|
||||
m_interfaceOut->setParameter("volume", "FLOW", "-6dB");
|
||||
// m_interfaceOut->setParameter("volume", "FLOW", "-6dB");
|
||||
|
||||
//Set stereo output:
|
||||
m_interfaceIn = m_manager->createInput(48000,
|
||||
@ -71,7 +71,7 @@ namespace river_test_muxer {
|
||||
double baseCycle = 2.0*M_PI/(double)48000 * 440;
|
||||
for (int32_t iii=0; iii<_nbChunk; iii++) {
|
||||
for (int32_t jjj=0; jjj<_map.size(); jjj++) {
|
||||
data[_map.size()*iii+jjj] = sin(m_phase) * 30000;
|
||||
data[_map.size()*iii+jjj] = sin(m_phase) * 7000;
|
||||
}
|
||||
m_phase += baseCycle;
|
||||
if (m_phase >= 2*M_PI) {
|
||||
|
@ -7,6 +7,8 @@
|
||||
#ifndef __RIVER_TEST_RECORD_CALLBACK_H__
|
||||
#define __RIVER_TEST_RECORD_CALLBACK_H__
|
||||
|
||||
#include <river/debug.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "test_record_callback"
|
||||
|
||||
@ -20,8 +22,6 @@ namespace river_test_record_callback {
|
||||
m_manager(_manager) {
|
||||
//Set stereo output:
|
||||
std::vector<audio::channel> channelMap;
|
||||
channelMap.push_back(audio::channel_frontLeft);
|
||||
channelMap.push_back(audio::channel_frontRight);
|
||||
m_interface = m_manager->createInput(48000,
|
||||
channelMap,
|
||||
audio::format_int16,
|
||||
@ -46,6 +46,7 @@ namespace river_test_record_callback {
|
||||
if (_format != audio::format_int16) {
|
||||
APPL_ERROR("call wrong type ... (need int16_t)");
|
||||
}
|
||||
RIVER_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) {
|
||||
@ -57,7 +58,7 @@ namespace river_test_record_callback {
|
||||
void run() {
|
||||
m_interface->start();
|
||||
// wait 2 second ...
|
||||
usleep(2000000);
|
||||
usleep(20000000);
|
||||
|
||||
|
||||
m_interface->stop();
|
||||
|
Loading…
Reference in New Issue
Block a user