1 /* 2 * Copyright (C) 2015-2020 Alibaba Group Holding Limited 3 * 4 */ 5 6 #ifndef __AUDIO_VAD_H__ 7 #define __AUDIO_VAD_H__ 8 9 10 enum { 11 VAD_STAT_NOISE = 0, 12 VAD_STAT_SPEECH, 13 }; 14 15 struct voice_active_detect { 16 void *handler; 17 int state; 18 int end_count; 19 int end_target; 20 long long start_time; 21 }; 22 23 #ifdef UVOICE_VAD_ENABLE 24 int audio_vad_process(struct voice_active_detect *vad, const uint8_t *buffer, int nbytes); 25 struct voice_active_detect *audio_vad_create(int rate, int period_size); 26 int audio_vad_release(struct voice_active_detect *vad); 27 #endif 28 29 30 #endif /* __AUDIO_VAD_H__ */ 31