Audio SDK 9.0.0
Loading...
Searching...
No Matches
Krisp::AudioSdk::Nc< FrameDataType > Class Template Reference

AI technology removes background noises, reverb, and background voices from the main speaker's voice in real-time, while also providing noise and voice statistics for the audio stream and frame. More...

#include <krisp-audio-sdk-nc.hpp>

Public Member Functions

void process (const FrameDataType *inputSamples, size_t numInputSamples, FrameDataType *outputSamples, size_t numOutputSamples, float noiseSuppressionLevel=100, PerFrameStats *frameStats=nullptr)
 Processes an input frame of audio data.
 
void getSessionStats (SessionStats *stats)
 Retrieves noise and voice statistics calculated from the start of NC processing. To enable statistics collection, ensure that NcSessionConfig::enableStats is set when creating the NC object. The recommended frequency for retrieving stats is 200ms or more. If it's required only at the end of the NC session, call this function once before the NC class object is destroyed.
 

Static Public Member Functions

static std::shared_ptr< Nc< FrameDataType > > create (const NcSessionConfig &config)
 Creates a new instance of Nc session.
 
static std::shared_ptr< Nc< FrameDataType > > create (const NcSessionConfigWithAutoModelSelect &config)
 Creates a new instance of Nc session by automatically selecting one of the NC outbound models provided. Applicable for outbound streams only.
 

Detailed Description

template<typename FrameDataType>
class Krisp::AudioSdk::Nc< FrameDataType >

AI technology removes background noises, reverb, and background voices from the main speaker's voice in real-time, while also providing noise and voice statistics for the audio stream and frame.

Template Parameters
FrameDataTypesupports int16 and float types.

Member Function Documentation

◆ create() [1/2]

template<typename FrameDataType >
static std::shared_ptr< Nc< FrameDataType > > Krisp::AudioSdk::Nc< FrameDataType >::create ( const NcSessionConfig & config)
static

Creates a new instance of Nc session.

Parameters
[in]configConfiguration for the Nc Session.
Return values
std::shared_ptr<NcSession>on success
Exceptions
Throwsstd exception in case of error.

◆ create() [2/2]

template<typename FrameDataType >
static std::shared_ptr< Nc< FrameDataType > > Krisp::AudioSdk::Nc< FrameDataType >::create ( const NcSessionConfigWithAutoModelSelect & config)
static

Creates a new instance of Nc session by automatically selecting one of the NC outbound models provided. Applicable for outbound streams only.

Parameters
[in]configConfiguration for the Nc Session with auto model select option.
Return values
std::shared_ptr<NcSession>on success
Exceptions
Throwsstd exception in case of error.

◆ getSessionStats()

template<typename FrameDataType >
void Krisp::AudioSdk::Nc< FrameDataType >::getSessionStats ( SessionStats * stats)

Retrieves noise and voice statistics calculated from the start of NC processing. To enable statistics collection, ensure that NcSessionConfig::enableStats is set when creating the NC object. The recommended frequency for retrieving stats is 200ms or more. If it's required only at the end of the NC session, call this function once before the NC class object is destroyed.

Parameters
statsSession statistics
Exceptions
Throwsstd exception in case of error.

◆ process()

template<typename FrameDataType >
void Krisp::AudioSdk::Nc< FrameDataType >::process ( const FrameDataType * inputSamples,
size_t numInputSamples,
FrameDataType * outputSamples,
size_t numOutputSamples,
float noiseSuppressionLevel = 100,
PerFrameStats * frameStats = nullptr )

Processes an input frame of audio data.

Parameters
[in]inputSamplesPointer to the input buffer containing audio samples. The buffer should hold enough samples to fill a frame of audio data, calculated as frameDuration * inputSampleRate / 1000 of FrameDataType samples.
[in]numInputSamplesThe number of samples in the input buffer. Must be sufficient to match the expected input frame size.
[out]outputSamplesPointer to the buffer for the processed audio samples. The caller must allocate a buffer of sufficient size to handle a frame of output samples, calculated as frameDuration * outputSampleRate / 1000 of FrameDataType samples.
[in]numOutputSamplesThe number of samples the output buffer can handle. Must be sufficient to match the expected output frame size.
[in]noiseSuppressionLevelOptional: Noise suppression level in the range [0, 100]% Used to adjust the intensity of the applied noise suppression. By default full 100% NC will be applied.
  • 0% indicates no noise suppression.
  • 100% indicates full noise suppression.
[out]frameStatsOptional: Frame statistics calculated during NC processing. Disabled by default; will be calculated if a valid pointer is provided.
Exceptions
Throwsstd exception in case of error.

The documentation for this class was generated from the following file: