YobeSDK 0.3.2
 
Loading...
Searching...
No Matches
Far-CAFE Listening

Introduction

The Far-CAFE (Conversational Audio Front-End) variant within the Yobe SDK is meant for situations where a person is talking far from a device while there are noise sources (including other voices) much closer to the device. The job of Far-CAFE is to extract the voice of the far-field person while pushing the near-field noise sources further into the auditory background. A typical use case would be a person talking to an appliance (that is making its own noise) from afar.

When to use this variant

  • This is a Far-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 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, as well as two configuration arguments: the Microphone Orientation and the Output Buffer Type.

// cpp
auto bio_listener = Yobe::Create::NewBioListener();
bio_listener->Init("YOBE_LICENSE", Yobe::MicOrientation::END_FIRE, Yobe::VoiceTarget::FAR_FIELD);
YOBE_SDK_API std::shared_ptr< BioListener > NewBioListener()
Creates a new instance of BioListener.
@ END_FIRE
This orientation has the target voice parallel to the line connecting the two microphones (ideally th...
@ FAR_FIELD
The target voice is far field (3 feet or more).

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 Double or PCM 16-bit Integer. The output buffer size can also vary from call to call.

// cpp
bio_listener->ProcessBuffer(input_buffer_ptr, out_buffer_ptr, 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();