Skip to main content
Skip table of contents

Speech Enhancement - Android

VDK currently features one Speech Enhancement library: vsdk-s2c.

Summary

Imports

JAVA
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:

JAVA
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.

JSON
{
    "s2c": {
      "speech_enhancement": {
        "speech_enhancers": {
          "<name>": {
            "configuration": "<configuration>"
          }
        }
      }
    }
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.