Krisp Audio SDK v6.0.0
Loading...
Searching...
No Matches
krisp-audio-sdk-nc-stats.hpp File Reference

Go to the source code of this file.

Classes

struct  krispAudioNcPerFrameInfo_t
 
struct  krispAudioNcVoiceStats_t
 
struct  krispAudioNcNoiseStats_t
 
struct  krispAudioNcStats_t
 

Typedefs

typedef struct krispAudioNcPerFrameInfo_t KrispAudioNcPerFrameInfo
 
typedef struct krispAudioNcVoiceStats_t KrispAudioNcVoiceStats
 
typedef struct krispAudioNcNoiseStats_t KrispAudioNcNoiseStats
 
typedef struct krispAudioNcStats_t KrispAudioNcStats
 

Enumerations

enum  KrispAudioCleanedSecondarySpeechStatus { UNDEFINED = 0 , DETECTED = 1 , NOT_DETECTED = 2 }
 

Functions

KRISP_AUDIO_API KrispAudioSessionID krispAudioNcWithStatsCreateSession (KrispAudioSamplingRate inputSampleRate, KrispAudioSamplingRate outputSampleRate, KrispAudioFrameDuration frameDuration, const char *modelName)
 This function creates Speech Enhance(Noise Canceler NC with stats) session object. More...
 
KRISP_AUDIO_API int krispAudioNcWithStatsCloseSession (KrispAudioSessionID pSession)
 This function releases all data tied to this particular session, closes the given NC session. More...
 
KRISP_AUDIO_API int krispAudioNcWithStatsCleanAmbientNoiseInt16 (KrispAudioSessionID pSession, const short *pFrameIn, unsigned int frameInSize, short *pFrameOut, unsigned int frameOutSize, KrispAudioNcPerFrameInfo *energyInfo)
 This function cleans the ambient noise for the given single frame. Works with shorts (int16) with value in range [-2^15+1, 2^15] More...
 
KRISP_AUDIO_API int krispAudioNcWithStatsCleanAmbientNoiseWithRingtoneInt16 (KrispAudioSessionID pSession, const short *pFrameIn, unsigned int frameInSize, short *pFrameOut, unsigned int frameOutSize, bool ringtone, KrispAudioNcPerFrameInfo *energyInfo)
 This function cleans the ambient noise for the given single frame,if there is no ringtone. Works with shorts (int16) with value in range [-2^15+1, 2^15] More...
 
KRISP_AUDIO_API int krispAudioNcWithStatsCleanAmbientNoiseFloat (KrispAudioSessionID pSession, const float *pFrameIn, unsigned int frameInSize, float *pFrameOut, unsigned int frameOutSize, KrispAudioNcPerFrameInfo *energyInfo)
 This function cleans the ambient noise for the given single frame. Works with floats with values normalized in range [-1,1] More...
 
KRISP_AUDIO_API int krispAudioNcWithStatsCleanAmbientNoiseWithRingtoneFloat (KrispAudioSessionID pSession, const float *pFrameIn, unsigned int frameInSize, float *pFrameOut, unsigned int frameOutSize, bool ringtone, KrispAudioNcPerFrameInfo *energyInfo)
 This function cleans the ambient noise for the given single frame, if there is no ringtone. Works with floats with values normalized in range [-1,1] More...
 
KRISP_AUDIO_API int krispAudioNcWithStatsRetrieveStats (KrispAudioSessionID pSession, KrispAudioNcStats *pStats)
 This function used to retrieve the noise/voice stats while processing noise canceler. The recommended stats retrieval frequency is bigger or equal to 200ms. If it's required only at the end of the noise canceler processing (end of the call/audio stream) function should be called before pSession becomes invalid, i.e. after closing the specified session. More...
 

Typedef Documentation

◆ KrispAudioNcNoiseStats

Krisp audio noise stats based on the noise intensity level

◆ KrispAudioNcPerFrameInfo

Krisp audio per-frame info

◆ KrispAudioNcStats

Krisp audio noise/voice stats

◆ KrispAudioNcVoiceStats

Krisp audio voice stats

Enumeration Type Documentation

◆ KrispAudioCleanedSecondarySpeechStatus

Copyright Krisp, Inc

Cleaned secondary speech states

Enumerator
UNDEFINED 
DETECTED 
NOT_DETECTED 

Function Documentation

◆ krispAudioNcWithStatsCleanAmbientNoiseFloat()

KRISP_AUDIO_API int krispAudioNcWithStatsCleanAmbientNoiseFloat ( KrispAudioSessionID  pSession,
const float *  pFrameIn,
unsigned int  frameInSize,
float *  pFrameOut,
unsigned int  frameOutSize,
KrispAudioNcPerFrameInfo energyInfo 
)

This function cleans the ambient noise for the given single frame. Works with floats with values normalized in range [-1,1]

Parameters
[in]pSessionThe NC With Stats Session to which the frame belongs
[in]pFrameInPointer to input frame. It's a continuous buffer with overall size of frameDuration * inputSampleRate / 1000
[in]frameInSizeThis is input buffer size which must be frameDuration * inputSampleRate / 1000
[in,out]pFrameOutProcessed frames. The caller should allocate a buffer of at least frameDuration * outputSampleRate / 1000 size
[in]frameOutSizeThis is output buffer size which must be frameDuration * outputSampleRate / 100
[out]energyInfoReturns voice and noise energy levels of the current frame
Return values
0success, negative on error

◆ krispAudioNcWithStatsCleanAmbientNoiseInt16()

KRISP_AUDIO_API int krispAudioNcWithStatsCleanAmbientNoiseInt16 ( KrispAudioSessionID  pSession,
const short *  pFrameIn,
unsigned int  frameInSize,
short *  pFrameOut,
unsigned int  frameOutSize,
KrispAudioNcPerFrameInfo energyInfo 
)

This function cleans the ambient noise for the given single frame. Works with shorts (int16) with value in range [-2^15+1, 2^15]

Parameters
[in]pSessionThe NC With Stats Session to which the frame belongs
[in]pFrameInPointer to input frame. It's a continuous buffer with overall size of frameDuration * inputSampleRate / 1000
[in]frameInSizeThis is input buffer size which must be frameDuration * inputSampleRate / 1000
[in,out]pFrameOutProcessed frames. The caller should allocate a buffer of at least frameDuration * outputSampleRate / 1000 size
[in]frameOutSize: this is output buffer size which must be frameDuration * outputSampleRate / 100
[out]energyInfoReturns voice and noise energy levels of the current frame
Return values
0success, negative on error

◆ krispAudioNcWithStatsCleanAmbientNoiseWithRingtoneFloat()

KRISP_AUDIO_API int krispAudioNcWithStatsCleanAmbientNoiseWithRingtoneFloat ( KrispAudioSessionID  pSession,
const float *  pFrameIn,
unsigned int  frameInSize,
float *  pFrameOut,
unsigned int  frameOutSize,
bool  ringtone,
KrispAudioNcPerFrameInfo energyInfo 
)

This function cleans the ambient noise for the given single frame, if there is no ringtone. Works with floats with values normalized in range [-1,1]

Parameters
[in]pSessionThe NC With Stats Session to which the frame belongs
[in]pFrameInPointer to input frame. It's a continuous buffer with overall size of frameDuration * inputSampleRate / 1000
[in]frameInSizeThis is input buffer size which must be frameDuration * inputSampleRate / 1000
[in,out]pFrameOutProcessed frames. The caller should allocate a buffer of at least frameDuration * outputSampleRate / 1000 size
[in]frameOutSizeThis is output buffer size which must be frameDuration * outputSampleRate / 100
[in]ringtone: This specifies whether there is ringtone in the pFrameIn input buffer. *
Return values
0Success
Parameters
[out]energyInfoReturns voice and noise energy levels of the current frame if ringtone is false otherwise 0.
Return values
0success, negative on error

◆ krispAudioNcWithStatsCleanAmbientNoiseWithRingtoneInt16()

KRISP_AUDIO_API int krispAudioNcWithStatsCleanAmbientNoiseWithRingtoneInt16 ( KrispAudioSessionID  pSession,
const short *  pFrameIn,
unsigned int  frameInSize,
short *  pFrameOut,
unsigned int  frameOutSize,
bool  ringtone,
KrispAudioNcPerFrameInfo energyInfo 
)

This function cleans the ambient noise for the given single frame,if there is no ringtone. Works with shorts (int16) with value in range [-2^15+1, 2^15]

Parameters
[in]pSessionThe NC With Stats Session to which the frame belongs
[in]pFrameInPointer to input frame. It's a continuous buffer with overall size of frameDuration * inputSampleRate / 1000
[in]frameInSizeThis is input buffer size which must be frameDuration * inputSampleRate / 1000
[in,out]pFrameOutProcessed frames. The caller should allocate a buffer of at least frameDuration * outputSampleRate / 1000 size
[in]frameOutSize: this is output buffer size which must be frameDuration * outputSampleRate / 100
[in]ringtone: This specifies whether there is ringtone in the pFrameIn input buffer.
[out]energyInfoReturns voice and noise energy levels of the current frame if ringtone is false otherwise 0.
Return values
0success, negative on error

◆ krispAudioNcWithStatsCloseSession()

KRISP_AUDIO_API int krispAudioNcWithStatsCloseSession ( KrispAudioSessionID  pSession)

This function releases all data tied to this particular session, closes the given NC session.

Parameters
[in,out]pSessionHandle to the NC with stats session to be closed
Return values
0success, negative on error

◆ krispAudioNcWithStatsCreateSession()

KRISP_AUDIO_API KrispAudioSessionID krispAudioNcWithStatsCreateSession ( KrispAudioSamplingRate  inputSampleRate,
KrispAudioSamplingRate  outputSampleRate,
KrispAudioFrameDuration  frameDuration,
const char *  modelName 
)

This function creates Speech Enhance(Noise Canceler NC with stats) session object.

Parameters
[in]inputSampleRateSampling frequency of the input data
[in]outputSampleRateSampling frequency of the output data
[in]frameDurationFrame duration
[in]modelNameThe session ties to this model, and cleans the future frames using it. If modelName is nullptr then the SDK auto-detects the model based on input sampleRate
Attention
Always provide modelName explicitly to avoid ambiguity
Returns
created session handle

◆ krispAudioNcWithStatsRetrieveStats()

KRISP_AUDIO_API int krispAudioNcWithStatsRetrieveStats ( KrispAudioSessionID  pSession,
KrispAudioNcStats pStats 
)

This function used to retrieve the noise/voice stats while processing noise canceler. The recommended stats retrieval frequency is bigger or equal to 200ms. If it's required only at the end of the noise canceler processing (end of the call/audio stream) function should be called before pSession becomes invalid, i.e. after closing the specified session.

Parameters
[in]pSessionThe NC With Stats Session to which the stats belongs
[out]pStatsNoise/Voice stats returned
Return values
0success, negative on error