Files
99_7018_lmx/cpu/br28/smart_voice/smart_voice.h

96 lines
3.4 KiB
C
Raw Normal View History

2025-10-29 13:10:02 +08:00
/*****************************************************************
>file name : smart_voice.h
>create time : Thu 17 Jun 2021 02:07:32 PM CST
*****************************************************************/
#ifndef _SMART_VOICE_H_
#define _SMART_VOICE_H_
#include "media/includes.h"
#define SMART_VOICE_MSG_WAKE 0 /*唤醒*/
#define SMART_VOICE_MSG_STANDBY 1 /*待机*/
#define SMART_VOICE_MSG_DMA 2 /*语音数据DMA传输*/
#define SMART_VOICE_MSG_MIC_OPEN 3 /*MIC打开*/
#define SMART_VOICE_MSG_SWITCH_SOURCE 4 /*MIC切换*/
#define SMART_VOICE_MSG_MIC_CLOSE 5 /*MIC关闭*/
#define ASR_CORE "audio_vad"
#define ASR_CORE_WAKEUP 0
#define ASR_CORE_STANDBY 1
/*
*********************************************************************
* audio smart voice detect create
* Description:
* Arguments : model - KWS模型
* task_name - VAD引擎task
* mic - MIC的选择MIC或主控MIC
* buffer_size - MIC的DMA数据缓冲大小
* Return : 0 - 0 - .
* Note(s) : None.
*********************************************************************
*/
int audio_smart_voice_detect_create(u8 model, u8 mic, int buffer_size);
/*
*********************************************************************
* audio smart voice detect open
* Description:
* Arguments : mic - MIC的选择MIC或主控MIC
* Return : void.
* Note(s) : None.
*********************************************************************
*/
void audio_smart_voice_detect_open(u8 mic);
/*
*********************************************************************
* audio smart voice detect close
* Description:
* Arguments : void.
* Return : void.
* Note(s) : 使mic.
*********************************************************************
*/
void audio_smart_voice_detect_close(void);
/*
*********************************************************************
* audio smart voice detect init
* Description:
* Arguments : mic_data - P11 mic初始化配置.
* Return : void.
* Note(s) : None.
*********************************************************************
*/
int audio_smart_voice_detect_init(struct vad_mic_platform_data *mic_data);
/*
*********************************************************************
* audio phone call kws start
* Description:
* Arguments : void.
* Return : 0 - 0 - .
* Note(s) : VAD的低功耗mic切换至通话使用的主控mic.
*********************************************************************
*/
int audio_phone_call_kws_start(void);
/*
*********************************************************************
* audio phone call kws close
* Description:
* Arguments : void.
* Return : 0 - 0 - .
* Note(s) : /.
*********************************************************************
*/
int audio_phone_call_kws_close(void);
#define smart_voice_core_post_msg(num, ...) os_taskq_post_msg(ASR_CORE, num, __VA_ARGS__)
int smart_voice_core_create(void *priv);
int smart_voice_core_free(void);
#endif