Audio Front-End - C++
VDK features only one Audio Front End: VAFE.
The VAFE provides analysis tools to determine your audio quality and some basic filters to improve it.
Summary
Configuration
Here is a template that needs to be added in the vsdk.json configuration file to use VAFE:
{
"vafe": {
"afe": {
"analyzers": {
"first": { "type": "snr" },
"second": { "type": "rt60", "bitspersample": 256 },
"third": { "type": "mos", "model": "path_to_mos_model.json" }
},
"filters": {
"filter1": { "type": "bandpass", "lowfrequency": 80, "highfrequency": 400 },
"filter2": { "type": "lowpass", "frequency": 80 },
"filter3": { "type": "highpass", "frequency": 400 }
}
}
}
}
Everything needs to be specified in this configuration file to be loaded later in the C++ code.
Specifying a filter here does not mean that it will be loaded by default.
Includes
#include <vsdk/afe/vafe.hpp>
Creating an Analyzer
auto const snrAnalyzer = engine->makeAnalyzer(name);
snrAnalyzer->subscribe([] (Vsdk::Afe::Analyzer::Result const & r) { ... });
p.pushBackConsumer(snrAnalyzer);
Creating a Filter
auto const bandpassFilter = engine->makeFilter("filter1");
p.pushBackModifier(bandpassFilter);
Insertion Order
Multiple analyzers and filters can be registered. Order has an importance, especially the modifiers (here filters) as they are called sequentially. You can use various methods of inserting to control the order:
p.pushBackModifier(filter1);
auto it = p.pushBackModifier(filter3);
p.insertModifier(it, filter2); // inserts filter2 between 1 and 3
Analyzers
Every values are normalized in percentage, with 100% as best value possible. Three analyzers type are available:
Type | Meaning | Description |
---|---|---|
SNR | Signal-Noise Ratio | Representation of the distance between speech and noise into the signal. |
RT60 | Reverb-Time for 60dB | Algorithm used to evaluate echo present in the data. |
MOS | Mean Opinion Score | Tries to evaluate audio as humans using machine learning. |
Filters
For the moment, only simple pass filters are available. They will make audio above or under a frequency less audible.
Type | Parameters | Description |
---|---|---|
bandpass |
| Soften signal under and above frequencies specified. |
lowpass |
| Soften data above specified frequency. |
highpass |
| Soften data under specified frequency. |