5d79f88918
2. 进一步修改了语音识别,关闭了关键词唤醒功能,只保留了指令识别功能 3. 构建了业务层的基本框架(增加了底层驱动对于的C++兼容),业务代码采用C++编写,启用了RTTI(运行时类型识别)
62 lines
1.7 KiB
C
62 lines
1.7 KiB
C
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include "esp_log.h"
|
|
#include "esp_check.h"
|
|
#include "unity.h"
|
|
#include "audio_player.h"
|
|
#include "driver/gpio.h"
|
|
#include "freertos/semphr.h"
|
|
|
|
#include "SD_MMC.h"
|
|
|
|
#define CONFIG_BSP_I2S_NUM 0
|
|
|
|
|
|
#define BSP_I2S_SCLK (GPIO_NUM_48)
|
|
#define BSP_I2S_MCLK (GPIO_NUM_NC)
|
|
#define BSP_I2S_LCLK (GPIO_NUM_38)
|
|
#define BSP_I2S_DOUT (GPIO_NUM_47)
|
|
#define BSP_I2S_DSIN (GPIO_NUM_NC)
|
|
|
|
#define BSP_I2S_GPIO_CFG \
|
|
{ \
|
|
.mclk = BSP_I2S_MCLK, \
|
|
.bclk = BSP_I2S_SCLK, \
|
|
.ws = BSP_I2S_LCLK, \
|
|
.dout = BSP_I2S_DOUT, \
|
|
.din = BSP_I2S_DSIN, \
|
|
.invert_flags = { \
|
|
.mclk_inv = false, \
|
|
.bclk_inv = false, \
|
|
.ws_inv = false, \
|
|
}, \
|
|
}
|
|
|
|
|
|
#define BSP_I2S_DUPLEX_MONO_CFG(_sample_rate) \
|
|
{ \
|
|
.clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(_sample_rate), \
|
|
.slot_cfg = I2S_STD_PHILIP_SLOT_DEFAULT_CONFIG(I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_MONO), \
|
|
.gpio_cfg = BSP_I2S_GPIO_CFG, \
|
|
}
|
|
|
|
#define Volume_MAX 100
|
|
extern bool Music_Next_Flag;
|
|
extern uint8_t Volume;
|
|
void Audio_Init(void);
|
|
void Play_Music(const char* directory, const char* fileName);
|
|
void Music_resume(void);
|
|
void Music_pause(void);
|
|
|
|
uint32_t Music_Duration(void);
|
|
uint32_t Music_Elapsed(void);
|
|
uint16_t Music_Energy(void);
|
|
void Volume_adjustment(uint8_t Volume);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif |