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

Go to the source code of this file.

Functions

KRISP_AUDIO_API KrispAudioSessionID krispAudioNcCreateSession (KrispAudioSamplingRate inputSampleRate, KrispAudioSamplingRate outputSampleRate, KrispAudioFrameDuration frameDuration, const char *modelName)
 This function creates Speech Enhance(Noise Canceler NC) session object. More...
 
KRISP_AUDIO_API int krispAudioNcCloseSession (KrispAudioSessionID pSession)
 This function releases all data tied to this particular session, closes the given NC session. More...
 
KRISP_AUDIO_API int krispAudioNcCleanAmbientNoiseInt16 (KrispAudioSessionID pSession, const short *pFrameIn, unsigned int frameInSize, short *pFrameOut, unsigned int frameOutSize)
 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 krispAudioNcCleanAmbientNoiseFloat (KrispAudioSessionID pSession, const float *pFrameIn, unsigned int frameInSize, float *pFrameOut, unsigned int frameOutSize)
 This function cleans the ambient noise for the given single frame. Works with floats with values normalized in range [-1,1] More...
 

Function Documentation

◆ krispAudioNcCleanAmbientNoiseFloat()

KRISP_AUDIO_API int krispAudioNcCleanAmbientNoiseFloat ( KrispAudioSessionID  pSession,
const float *  pFrameIn,
unsigned int  frameInSize,
float *  pFrameOut,
unsigned int  frameOutSize 
)

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 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
Return values
0success, negative on error

◆ krispAudioNcCleanAmbientNoiseInt16()

KRISP_AUDIO_API int krispAudioNcCleanAmbientNoiseInt16 ( KrispAudioSessionID  pSession,
const short *  pFrameIn,
unsigned int  frameInSize,
short *  pFrameOut,
unsigned int  frameOutSize 
)

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 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
Return values
0success, negative on error

◆ krispAudioNcCloseSession()

KRISP_AUDIO_API int krispAudioNcCloseSession ( KrispAudioSessionID  pSession)

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

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

◆ krispAudioNcCreateSession()

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

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

Copyright Krisp, Inc

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 than the sdk auto-detecs the model based on input sampleRate
Attention
Always provide modelName explicitly to avoid ambiguity
Returns
created session handle