#ifndef SA_AUDIO_H
#define SA_AUDIO_H

#define POWER_ON_FILE       CONFIG_VOICE_PROMPT_FILE_PATH"poweron.mp3"
#define FAIL_FILE           CONFIG_VOICE_PROMPT_FILE_PATH"AsrEmpty.mp3"
#define NET_UNVALID_FILE    CONFIG_VOICE_PROMPT_FILE_PATH"AiAsrFail.mp3"
#define CANCEL_FILE         CONFIG_VOICE_PROMPT_FILE_PATH"ring.mp3"
#define BT_OPEN_FILE        CONFIG_VOICE_PROMPT_FILE_PATH"BtOpen.mp3"
#define NET_CFG_ENTER_FILE  CONFIG_VOICE_PROMPT_FILE_PATH"NetCfgEnter.mp3"
#define NET_CFG_SUCC_FILE   CONFIG_VOICE_PROMPT_FILE_PATH"NetCfgSucc.mp3"
#define NET_CFG_FAIL_FILE   CONFIG_VOICE_PROMPT_FILE_PATH"NetCfgFail.mp3"
#define NET_CFG_TO_FILE     CONFIG_VOICE_PROMPT_FILE_PATH"NetCfgTo.mp3"
#define NET_EMPTY_FILE      CONFIG_VOICE_PROMPT_FILE_PATH"NetEmpty.mp3"
#define NET_CONN_FILE       CONFIG_VOICE_PROMPT_FILE_PATH"NetConnting.mp3"
#define NET_DISC_FILE       CONFIG_VOICE_PROMPT_FILE_PATH"NetDisc.mp3"
#define SSID_RECV_FILE      CONFIG_VOICE_PROMPT_FILE_PATH"SsidRecv.mp3"
#define SER_DISC_FILE       CONFIG_VOICE_PROMPT_FILE_PATH"SerDiscon.mp3"
#define OTA_IN_FILE         CONFIG_VOICE_PROMPT_FILE_PATH"OtaKey.mp3"
#define OTA_SUCC_FILE       CONFIG_VOICE_PROMPT_FILE_PATH"OtaSuccess.mp3"
#define OTA_FAIL_FILE       CONFIG_VOICE_PROMPT_FILE_PATH"OtaFailed.mp3"
#define VOLUME_UP_FILE      CONFIG_VOICE_PROMPT_FILE_PATH"VolumeUp.mp3"
#define VOLUME_DOWN_FILE    CONFIG_VOICE_PROMPT_FILE_PATH"VolumeDown.mp3"
#define VOLUME_FULL_FILE    CONFIG_VOICE_PROMPT_FILE_PATH"VolumeFull.mp3"
#define VOLUME_FILE            CONFIG_VOICE_PROMPT_FILE_PATH"Volume.mp3"
#define AGENT_QUITE_NOTICE     CONFIG_VOICE_PROMPT_FILE_PATH"AgentFailed.mp3"
#define AGENT_RECOVER_NOTICE   CONFIG_VOICE_PROMPT_FILE_PATH"AgentRe.mp3"
#define AGENT_RECOVER_FREQUEN  CONFIG_VOICE_PROMPT_FILE_PATH"AgentRetry.mp3"
#define DEVICE_POWER_OFF CONFIG_VOICE_PROMPT_FILE_PATH"PowerOff.mp3"

#define SH_OS_TASKQ_POST(name,argc, ...)                       \
    do{                                                         \
        int err =  os_taskq_post(name,argc, __VA_ARGS__);       \
        if(err){                                                \
            printf("\n %s %d err = %d\n",__func__,__LINE__,err); \
        }                                                       \
    }while(0)

enum {
    SH_WS_CONN = 0,
    SH_WS_SEND_AUDIO,
    SH_WS_EXIT,
};

typedef struct sa_audio_hdl sa_audio_hdl;


// struct sa_audio_hdl* get_sa_audio_handler(void);

int sa_audio_init(void);
void sa_audio_mode_exit(void);

int set_dec_volume(int step);

int play_file(const char* file_path);
int play_mix_file(const char *path);

int open_audio_enc();
int close_audio_enc();

int open_audio_dec(void* priv);
int close_audio_dec();

int net_music_dec_file(const char *url);


#endif
