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>
|
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 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.
|
|
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
-
FrameDataType | supports int16 and float types. |
◆ create() [1/2]
template<typename FrameDataType >
Creates a new instance of Nc session.
- Parameters
-
[in] | config | Configuration for the Nc Session. |
- Return values
-
std::shared_ptr<NcSession> | on success |
- Exceptions
-
Throws | std exception in case of error. |
◆ create() [2/2]
template<typename FrameDataType >
Creates a new instance of Nc session by automatically selecting one of the NC outbound models provided. Applicable for outbound streams only.
- Parameters
-
[in] | config | Configuration for the Nc Session with auto model select option. |
- Return values
-
std::shared_ptr<NcSession> | on success |
- Exceptions
-
Throws | std exception in case of error. |
◆ getSessionStats()
template<typename FrameDataType >
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
-
- Exceptions
-
Throws | std 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] | inputSamples | Pointer 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] | numInputSamples | The number of samples in the input buffer. Must be sufficient to match the expected input frame size. |
[out] | outputSamples | Pointer 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] | numOutputSamples | The number of samples the output buffer can handle. Must be sufficient to match the expected output frame size. |
[in] | noiseSuppressionLevel | Optional: 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] | frameStats | Optional: Frame statistics calculated during NC processing. Disabled by default; will be calculated if a valid pointer is provided. |
- Exceptions
-
Throws | std exception in case of error. |
The documentation for this class was generated from the following file: