Speech Enhancement - Android
VDK currently features one Speech Enhancement library: vsdk-s2c.
Summary
Imports
import com.vivoka.speechenhancement.s2c.Engine;
import com.vivoka.vsdk.speechenhancement.SpeechEnhancer;
Creating and using a SpeechEnhancer
A SpeechEnhancer
is used to take audio data in and get new audio data out, so it works as an audio modifier in the Pipeline
!
Let’s say you want to record audio, clean its audio and write the output into another file:
Engine.getInstance().init(this, new IEngineCallback() {
@Override
public void onCompleted(boolean success) {
if (success) {
try {
// If engine init is a success, init and start the pipeline
Pipeline = new Pipeline();
// Create an audioRecorder used as a pipeline producer
AudioRecorder recorder = new AudioRecorder(format);
Pipeline.setProducer(recorder);
// Add the enhancer to the pipeline
SpeechEnhancer enhance = Engine.getInstance().getSpeechEnhancer(ENHANCER_NAME);
Pipeline.pushBackModifier(enhancer);
// Create the buffer used to recover processed audio
BufferModuleIn consumer = new BufferModuleIn(1, 16000);
pipeline.pushBackConsumer(consumer);
Pipeline.start();
} catch (Exception e) {
Log.e(TAG, e.getFormattedMessage())
}
} else {
Log.e(TAG, "Could not init enhancement engine properly, please read the logs");
}
}
});
Configuration
The Speech Enhancer Engine must be configured using the VDK Studio.
Here is the template that will be added automatically in the vsdk.json
configuration file during export.
{
"s2c": {
"speech_enhancement": {
"speech_enhancers": {
"<name>": {
"configuration": "<configuration>"
}
}
}
}
}