Call Center SDK  1.11.3
attributes_c_api.h
1 /* Copyright 2022 ID R&D Inc. All Rights Reserved. */
2 
3 #pragma once
4 
5 #include <stddef.h>
6 #include <stdint.h>
7 
8 #include <voicesdk/core/config.h>
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
17 typedef enum VoiceSdkGender { GENDER_MALE = 0, GENDER_FEMALE = 1 } VoiceSdkGender;
18 
23 typedef enum VoiceSdkPhoneCallParticipant {
24  PHONE_CALL_PARTICIPANT_OPERATOR = 0,
25  PHONE_CALL_PARTICIPANT_CUSTOMER = 1,
26  PHONE_CALL_PARTICIPANT_OTHER = 2,
27  PHONE_CALL_PARTICIPANT_UNDEFINED = 3
28 } VoiceSdkPhoneCallParticipant;
29 
33 typedef struct VoiceSdkAttributes {
34 
39  float gender_score;
40 
44  VoiceSdkGender gender;
45 
49  size_t age;
50 
55  VoiceSdkPhoneCallParticipant phone_call_participant;
57 
58 typedef struct VoiceSdkAttributesEstimator VoiceSdkAttributesEstimator;
59 
66 VOICE_SDK_API
67 VoiceSdkAttributesEstimator* VoiceSdkAttributesEstimatorCreate(const char* init_path, char** error_msg);
68 
73 VOICE_SDK_API
74 void VoiceSdkAttributesEstimatorRelease(VoiceSdkAttributesEstimator* estimator);
75 
86 VOICE_SDK_API
87 bool VoiceSdkAttributesEstimatorEstimateWavFile(const VoiceSdkAttributesEstimator* estimator, const char* wav_path,
88  VoiceSdkAttributes* attributes, char** error_msg);
89 
99 VOICE_SDK_API
100 bool VoiceSdkAttributesEstimatorEstimateAudioFile(const VoiceSdkAttributesEstimator* estimator, const char* audio_path,
101  VoiceSdkAttributes* attributes, char** error_msg);
102 
115 VOICE_SDK_API
116 bool VoiceSdkAttributesEstimatorEstimateFloatSamples(const VoiceSdkAttributesEstimator* estimator,
117  const float* float_samples, size_t num_samples, size_t sample_rate,
118  VoiceSdkAttributes* attributes, char** error_msg);
119 
131 VOICE_SDK_API
132 bool VoiceSdkAttributesEstimatorEstimatePcm16Samples(const VoiceSdkAttributesEstimator* estimator,
133  const int16_t* samples, size_t num_samples, size_t sample_rate,
134  VoiceSdkAttributes* attributes, char** error_msg);
135 
147 VOICE_SDK_API
148 bool VoiceSdkAttributesEstimatorEstimatePcm16Bytes(const VoiceSdkAttributesEstimator* estimator, const uint8_t* bytes,
149  size_t num_bytes, size_t sample_rate, VoiceSdkAttributes* attributes,
150  char** error_msg);
151 
152 #ifdef __cplusplus
153 }
154 #endif
Structure representing estimated person attributes.
Definition: attributes_c_api.h:33
VoiceSdkGender gender
Estimated gender.
Definition: attributes_c_api.h:44
float gender_score
Raw gender score (the bigger score corresponding to male and the smaller score corresponding to femal...
Definition: attributes_c_api.h:39
VoiceSdkPhoneCallParticipant phone_call_participant
Estimated phone call participant class. Makes sense only for single speaker phone call recordings.
Definition: attributes_c_api.h:55
size_t age
Estimated age in years.
Definition: attributes_c_api.h:49