YobeSDK  0.2.1
Near-CAFE Listening

Introduction

The Near-CAFE (Conversational Audio Front-End) variant within the Yobe SDK is meant for situations where a person is talking close to a device while there are noise sources (including other voices) much farther from the device. The job of Near-CAFE is to extract the voice of the near-field person while pushing the far-field noise sources further into the auditory background. A typical use case would be a person talking into a smartphone while there is considerable ambient noise in the environment.

When to use this variant

  • This is a Near-Listening scenario as shown in the diagram below:
  • Processed audio is desired to contain as much of the speech and as little of the noise as possible.

Prerequisites

Place the provided libraries and header files in a location that can be discovered by your application's build system.

BioListener (Voice Extraction)

CAFE's main functionality (biometric listening) is accessed via the Yobe::BioListener class.

Initialization

Yobe::Create::NewBioListener is used to obtain a shared pointer to a new Yobe::BioListener instance. The instance must then be initialized using the license provided by Yobe.

// cpp
auto bio_listener = Yobe::Create::NewBioListener();
bio_listener->Init("YOBE_LICENSE");
YOBE_SDK_API std::shared_ptr< BioListener > NewBioListener()
Creates a new instance of BioListener.

Note: Both Near-CAFE and Far-CAFE use the same class implementation. Hence, only one of the solutions can be used at a time. To verify your version, you can use the following:

// cpp
bio_listener->GetVoiceTarget();

Process and Use Audio

Audio data is passed into the Yobe::BioListener one buffer at a time. See Audio Buffers for more details on their format. As seen in the method signatures for the Yobe::BioListener::ProcessBuffer functions, the audio can be encoded as PCM 16-bit Integer or 64-bit Double. The output buffer size can also vary from call to call.

// cpp
bio_listener->ProcessBuffer(input_buffer, out_buffer, input_size, &out_buffer_size);

out_buffer in the above example now contains the processed version of the audio that is contained in input_buffer. An example of what to do with this out_buffer is to append its contents to a stream or larger buffer.

Note: You can find the library's built in buffer size using Yobe::Info::InputBufferSize.

Deinitialization

To ensure BioListener is properly deinitialized, simply call Yobe::BioListener::Deinit.

// cpp
bio_listener->Deinit();