Krisp Audio SDK v6.0.0
|
#include "krisp-audio-sdk.hpp"
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 struct krispAudioNcNoiseStats_t KrispAudioNcNoiseStats |
Krisp audio noise stats based on the noise intensity level
typedef struct krispAudioNcPerFrameInfo_t KrispAudioNcPerFrameInfo |
Krisp audio per-frame info
typedef struct krispAudioNcStats_t KrispAudioNcStats |
Krisp audio noise/voice stats
typedef struct krispAudioNcVoiceStats_t KrispAudioNcVoiceStats |
Krisp audio voice stats
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]
[in] | pSession | The NC With Stats Session to which the frame belongs |
[in] | pFrameIn | Pointer to input frame. It's a continuous buffer with overall size of frameDuration * inputSampleRate / 1000 |
[in] | frameInSize | This is input buffer size which must be frameDuration * inputSampleRate / 1000 |
[in,out] | pFrameOut | Processed 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] | energyInfo | Returns voice and noise energy levels of the current frame |
0 | success, negative on error |
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]
[in] | pSession | The NC With Stats Session to which the frame belongs |
[in] | pFrameIn | Pointer to input frame. It's a continuous buffer with overall size of frameDuration * inputSampleRate / 1000 |
[in] | frameInSize | This is input buffer size which must be frameDuration * inputSampleRate / 1000 |
[in,out] | pFrameOut | Processed 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] | energyInfo | Returns voice and noise energy levels of the current frame |
0 | success, negative on error |
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]
[in] | pSession | The NC With Stats Session to which the frame belongs |
[in] | pFrameIn | Pointer to input frame. It's a continuous buffer with overall size of frameDuration * inputSampleRate / 1000 |
[in] | frameInSize | This is input buffer size which must be frameDuration * inputSampleRate / 1000 |
[in,out] | pFrameOut | Processed 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. * |
0 | Success |
[out] | energyInfo | Returns voice and noise energy levels of the current frame if ringtone is false otherwise 0. |
0 | success, negative on error |
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]
[in] | pSession | The NC With Stats Session to which the frame belongs |
[in] | pFrameIn | Pointer to input frame. It's a continuous buffer with overall size of frameDuration * inputSampleRate / 1000 |
[in] | frameInSize | This is input buffer size which must be frameDuration * inputSampleRate / 1000 |
[in,out] | pFrameOut | Processed 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] | energyInfo | Returns voice and noise energy levels of the current frame if ringtone is false otherwise 0. |
0 | success, negative on error |
KRISP_AUDIO_API int krispAudioNcWithStatsCloseSession | ( | KrispAudioSessionID | pSession | ) |
This function releases all data tied to this particular session, closes the given NC session.
[in,out] | pSession | Handle to the NC with stats session to be closed |
0 | success, negative on error |
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.
[in] | inputSampleRate | Sampling frequency of the input data |
[in] | outputSampleRate | Sampling frequency of the output data |
[in] | frameDuration | Frame duration |
[in] | modelName | The 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 |
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.
[in] | pSession | The NC With Stats Session to which the stats belongs |
[out] | pStats | Noise/Voice stats returned |
0 | success, negative on error |