Files
99_7018_lmx/cpu/br28/audio_effect_develop.c

68 lines
1.8 KiB
C
Raw Normal View History

2025-10-29 13:10:02 +08:00
/*************************************************************************************************/
/*!
* \file audio_effect_develop.c
*
* \brief
*
* Copyright (c) 2011-2023 ZhuHai Jieli Technology Co.,Ltd.
*
*/
/*************************************************************************************************/
#include "app_config.h"
#include "audio_effect_develop.h"
#if ((defined TCFG_EFFECT_DEVELOP_ENABLE) && TCFG_EFFECT_DEVELOP_ENABLE)
struct audio_effect_develop_handle {
int sample_rate;
u8 nch;
u8 bit_width;
};
void *audio_effect_develop_open(int sample_rate, u8 nch, u8 bit_width)
{
struct audio_effect_develop_handle *hdl = (struct audio_effect_develop_handle *)zalloc(sizeof(struct audio_effect_develop_handle));
if (!hdl) {
return NULL;
}
hdl->sample_rate = sample_rate;
hdl->nch = nch;
hdl->bit_width = bit_width;
//TODO : 打开算法模块
return hdl;
}
void audio_effect_develop_close(void *priv)
{
struct audio_effect_develop_handle *hdl = (struct audio_effect_develop_handle *)priv;
//TODO : 关闭算法模块
if (hdl) {
free(hdl);
}
}
/*********************************************************************** 
 *  
 * Input    :  priv -  
               data - pcm数据(16bit) 
               len  - pcm数据的byte长度 
 * Output   :   
 * Notes    : 
 * History  : 
 *==============================================================*/  
int audio_effect_develop_data_handler(void *priv, void *data, int len)
{
struct audio_effect_develop_handle *hdl = (struct audio_effect_develop_handle *)priv;
//TODO : 音效运行
return len;
}
#endif