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

Go to the source code of this file.

Classes

struct  krispAudioVersionInfo_t
 

Macros

#define KRISP_AUDIO_API
 

Typedefs

typedef void * KrispAudioSessionID
 
typedef struct krispAudioVersionInfo_t KrispAudioVersionInfo
 

Enumerations

enum  KrispAudioSamplingRate {
  KRISP_AUDIO_SAMPLING_RATE_8000HZ =8000 , KRISP_AUDIO_SAMPLING_RATE_16000HZ =16000 , KRISP_AUDIO_SAMPLING_RATE_32000HZ =32000 , KRISP_AUDIO_SAMPLING_RATE_44100HZ =44100 ,
  KRISP_AUDIO_SAMPLING_RATE_48000HZ =48000 , KRISP_AUDIO_SAMPLING_RATE_88200HZ =88200 , KRISP_AUDIO_SAMPLING_RATE_96000HZ =96000
}
 
enum  KrispAudioFrameDuration { KRISP_AUDIO_FRAME_DURATION_10MS =10 , KRISP_AUDIO_FRAME_DURATION_20MS =20 , KRISP_AUDIO_FRAME_DURATION_30MS =30 , KRISP_AUDIO_FRAME_DURATION_40MS =40 }
 

Functions

KRISP_AUDIO_API int krispAudioGlobalInit (const wchar_t *workingPath)
 This function initializes the global data needed for the SDK. More...
 
KRISP_AUDIO_API int krispAudioGlobalDestroy ()
 This function frees all global resources allocated by SDK. The session's data will also be released and can't be used in future. More...
 
KRISP_AUDIO_API int krispAudioGetVersion (KrispAudioVersionInfo *versionInfo)
 This function populates the versionInfo structure with API version information upon successful completion. More...
 
KRISP_AUDIO_API int krispAudioSetModel (const wchar_t *weightFilePath, const char *modelName)
 This function sets the Krisp model to be used. The weight file for provided model must exist. Several models can be set. The specified model is later tied to specific session during the session creation process. More...
 
KRISP_AUDIO_API int krispAudioRemoveModel (const char *modelName)
 This function removes the Krisp model. More...
 
KRISP_AUDIO_API unsigned int krispAudioGetFrameEnergyFloat (const float *pFrameIn, unsigned int frameInSize)
 This function returns the energy amount for the given frame. Works with floats with values normalized in range [-1,1] Note: It may be used without initializing global SDK context by krispAudioGlobalInit() More...
 
KRISP_AUDIO_API unsigned int krispAudioGetFrameEnergyInt16 (const short *pFrameIn, unsigned int frameInSize)
 This function returns the energy amount for the given frame. Works with shorts (int16) with value in range [-2^15+1, 2^15] Note: It may be used without initializing global SDK context by krispAudioGlobalInit() More...
 

Macro Definition Documentation

◆ KRISP_AUDIO_API

#define KRISP_AUDIO_API

Copyright Krisp, Inc

Typedef Documentation

◆ KrispAudioSessionID

typedef void* KrispAudioSessionID

◆ KrispAudioVersionInfo

Enumeration Type Documentation

◆ KrispAudioFrameDuration

Enumerator
KRISP_AUDIO_FRAME_DURATION_10MS 
KRISP_AUDIO_FRAME_DURATION_20MS 
KRISP_AUDIO_FRAME_DURATION_30MS 
KRISP_AUDIO_FRAME_DURATION_40MS 

◆ KrispAudioSamplingRate

Enumerator
KRISP_AUDIO_SAMPLING_RATE_8000HZ 
KRISP_AUDIO_SAMPLING_RATE_16000HZ 
KRISP_AUDIO_SAMPLING_RATE_32000HZ 
KRISP_AUDIO_SAMPLING_RATE_44100HZ 
KRISP_AUDIO_SAMPLING_RATE_48000HZ 
KRISP_AUDIO_SAMPLING_RATE_88200HZ 
KRISP_AUDIO_SAMPLING_RATE_96000HZ 

Function Documentation

◆ krispAudioGetFrameEnergyFloat()

KRISP_AUDIO_API unsigned int krispAudioGetFrameEnergyFloat ( const float *  pFrameIn,
unsigned int  frameInSize 
)

This function returns the energy amount for the given frame. Works with floats with values normalized in range [-1,1] Note: It may be used without initializing global SDK context by krispAudioGlobalInit()

Parameters
[in]pFrameInpFrameIn Pointer to input frame.
[in]frameInSizeThis is buffer size.
Returns
Value in range [0, 100].

◆ krispAudioGetFrameEnergyInt16()

KRISP_AUDIO_API unsigned int krispAudioGetFrameEnergyInt16 ( const short *  pFrameIn,
unsigned int  frameInSize 
)

This function returns the energy amount for the given frame. Works with shorts (int16) with value in range [-2^15+1, 2^15] Note: It may be used without initializing global SDK context by krispAudioGlobalInit()

Parameters
[in]pFrameInpFrameIn Pointer to input frame.
[in]frameInSizeThis is buffer size.
Returns
Value in range [0, 100].

◆ krispAudioGetVersion()

KRISP_AUDIO_API int krispAudioGetVersion ( KrispAudioVersionInfo versionInfo)

This function populates the versionInfo structure with API version information upon successful completion.

Parameters
[in,out]versionInfoThe structure that gets populated upon successful completion of this call. Contains major , minor , patch and build components.
Return values
0success, negative on error

◆ krispAudioGlobalDestroy()

KRISP_AUDIO_API int krispAudioGlobalDestroy ( )

This function frees all global resources allocated by SDK. The session's data will also be released and can't be used in future.

Return values
0success, negative on error

◆ krispAudioGlobalInit()

KRISP_AUDIO_API int krispAudioGlobalInit ( const wchar_t *  workingPath)

This function initializes the global data needed for the SDK.

Parameters
[in]workingPathThe path to the working directory. Can be nullptr to have the default behavior.
Return values
0success, negative on error

◆ krispAudioRemoveModel()

KRISP_AUDIO_API int krispAudioRemoveModel ( const char *  modelName)

This function removes the Krisp model.

Parameters
[in]modelNameModel name alias that allows to remove model that has been set.
Return values
0success, negative on error

◆ krispAudioSetModel()

KRISP_AUDIO_API int krispAudioSetModel ( const wchar_t *  weightFilePath,
const char *  modelName 
)

This function sets the Krisp model to be used. The weight file for provided model must exist. Several models can be set. The specified model is later tied to specific session during the session creation process.

Parameters
[in]weightFilePathThe Krisp model weight file associated with the model
[in]modelNameModel name alias that allows to later distinguish between different models that have been set by this function call
Return values
0success, negative on error