first
This commit is contained in:
48
include_lib/media/tech_lib/LFaudio_plc_api.h
Normal file
48
include_lib/media/tech_lib/LFaudio_plc_api.h
Normal file
@ -0,0 +1,48 @@
|
||||
#ifndef _LFaudio_PLC_API_H
|
||||
#define _LFaudio_PLC_API_H
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct _LFaudio_PLC_API {
|
||||
unsigned int (*need_buf)(int nch);
|
||||
void (*open)(unsigned char *ptr, int nch, int mode); //mode从0到4, 4是最低延时
|
||||
int (*run)(unsigned char *ptr, short *inbuf, short *obuf, short len, short err_flag); //len是按多少个点的,inbuf跟obuf可以同址的
|
||||
} LFaudio_PLC_API;
|
||||
|
||||
|
||||
extern LFaudio_PLC_API *get_lfaudioPLC_api();
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
|
||||
#define PACKET_LEN 30
|
||||
#define PACKET_FILL_VAL 0x1500
|
||||
|
||||
/*调用示例*/
|
||||
{
|
||||
int bufsize;
|
||||
unsigned char *bufptr;
|
||||
BT15_REPAIR_API *test_repair = get_repair_api();
|
||||
|
||||
bufsize = test_repair->need_buf(nch);
|
||||
bufptr = malloc(bufsize); //开辟空间
|
||||
test_repair->open(bufptr, nch); //传入参数,参数1是buf地址,参数2是声道, 参数3是延时模式
|
||||
|
||||
while (1) {
|
||||
fread(inbuf, 2, PACKET_LEN, fpin);
|
||||
if (feof(fpin)) {
|
||||
break; //input data
|
||||
}
|
||||
|
||||
test_repair->run(bufptr, inbuf, outbuf, PACKET_LEN, err); //err=1是差错帧,要不然为0
|
||||
|
||||
fwrite(outbuf, 2, PACKET_LEN, fpout); //output data
|
||||
|
||||
}
|
||||
|
||||
free(bufptr);
|
||||
|
||||
}
|
||||
#endif
|
||||
31
include_lib/media/tech_lib/SensorCalib_api.h
Normal file
31
include_lib/media/tech_lib/SensorCalib_api.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef SENSORCALIB_API_H
|
||||
#define SENSORCALIB_API_H
|
||||
#include "tech_lib/SpatialAudio_api.h"
|
||||
|
||||
//校准阈值
|
||||
typedef struct {
|
||||
float thv1;//加速度计校准阈值1
|
||||
float thv2;//
|
||||
} Thval_t;
|
||||
|
||||
enum {
|
||||
type_0 = 0,
|
||||
type_1,
|
||||
type_2
|
||||
};
|
||||
enum {
|
||||
mode_0 = 0,
|
||||
mode_1
|
||||
};
|
||||
|
||||
int GroCelBuff();
|
||||
void GroCelInit(void *buf, info_spa_t *para, int time);
|
||||
int Gro_Calibration(void *ptr, short *data, info_spa_t *para, tranval_t *, int mode, gyro_cel_t *agv);
|
||||
|
||||
int AccCelBuff();
|
||||
void AccCelInit(void *ptr, info_spa_t *para, int time);
|
||||
int Acc_Calibration(void *ptr, short *data, info_spa_t *para, acc_cel_t *ac, Thval_t *tv);
|
||||
|
||||
#endif // !1
|
||||
|
||||
|
||||
54
include_lib/media/tech_lib/SpatialAudio_api.h
Normal file
54
include_lib/media/tech_lib/SpatialAudio_api.h
Normal file
@ -0,0 +1,54 @@
|
||||
#ifndef SPATIALAUDIO_API_H
|
||||
#define SPATIALAUDIO_API_H
|
||||
|
||||
typedef struct TRANVAL {
|
||||
int trans_x[3];
|
||||
int trans_y[3];
|
||||
int trans_z[3];
|
||||
|
||||
} tranval_t;
|
||||
|
||||
typedef struct COMMON_INFO {
|
||||
float fs;//采样率
|
||||
int len;//一包数据长度
|
||||
float sensitivity;//陀螺仪灵敏度
|
||||
int range;//加速度计量程(正)
|
||||
} info_spa_t;
|
||||
|
||||
typedef struct {
|
||||
float beta;
|
||||
float val;//陀螺仪参考阈值
|
||||
float cel_val;//动态校准参考阈值
|
||||
float time;//动态校准时长
|
||||
float SerialTime;//动态校准窗长
|
||||
float sensval;//角度灵敏度,越小越灵敏,范围:0.01~0.1,默认0.1
|
||||
} spatial_config_t;
|
||||
|
||||
//陀螺仪偏置
|
||||
typedef struct {
|
||||
float gyro_x;
|
||||
float gyro_y;
|
||||
float gyro_z;
|
||||
} gyro_cel_t;
|
||||
|
||||
//加速度计偏置
|
||||
typedef struct {
|
||||
float acc_offx;
|
||||
float acc_offy;
|
||||
float acc_offz;
|
||||
} acc_cel_t;
|
||||
|
||||
extern inline float root_float(float x);
|
||||
extern inline float angle_float(float x, float y);
|
||||
int get_Spatial_buf(int len);
|
||||
void init_Spatial(void *ptr, info_spa_t *, tranval_t *, spatial_config_t *, gyro_cel_t *, acc_cel_t *ac);
|
||||
void Spatial_cacl(void *ptr, short *data);
|
||||
int get_Spa_angle(void *ptr, float alpha, float voloct);
|
||||
void Spatial_reset(void *ptr);
|
||||
int Spatial_stra(void *ptr, int time, float val1);
|
||||
int get_test_angle(void *ptr);
|
||||
//int get_Pitch_angle(void* ptr);
|
||||
|
||||
#endif // !1
|
||||
|
||||
|
||||
80
include_lib/media/tech_lib/effect_surTheta_api.h
Normal file
80
include_lib/media/tech_lib/effect_surTheta_api.h
Normal file
@ -0,0 +1,80 @@
|
||||
#ifndef effect_surTheta_h__
|
||||
#define effect_surTheta_h__
|
||||
|
||||
typedef struct _PointSound360TD_PARM_SET {
|
||||
int theta;
|
||||
int volume;
|
||||
} PointSound360TD_PARM_SET;
|
||||
|
||||
//混响参数
|
||||
typedef struct _RP_PARM_CONIFG {
|
||||
int trackKIND; //角度合成算法用哪一种 :0或者1
|
||||
int ReverbKIND; //2或者3
|
||||
int reverbance; //湿声比例 : 0~100
|
||||
int dampingval; //高频decay :0~80
|
||||
} RP_PARM_CONIFG;
|
||||
|
||||
typedef struct _PointSound360Reverb_PARM_SET {
|
||||
unsigned char reverbance; //0-100: //reverb parm
|
||||
unsigned char dampingval; //0-100% //reverb parm
|
||||
unsigned char voltrack; // 0-1 // vol track
|
||||
char doangle; // 0 or 1
|
||||
|
||||
char diangle; // 0-360 : 2 channel angle
|
||||
unsigned char wet; //0-100://backgroud
|
||||
unsigned char dry; //0-100 ://voice part
|
||||
char reverb_kind; //reverb kind
|
||||
|
||||
unsigned short k1_w; //0-2000: output wetgain
|
||||
unsigned short k1_d; //0-2000: output drygain
|
||||
|
||||
char reverb_part; // 0-128 // mix wet and wet_dry reverb
|
||||
|
||||
char reserved0;
|
||||
short dest_vol; // dest vol;
|
||||
|
||||
} PointSound360Reverb_PARM_SET;
|
||||
|
||||
//角度合成算法定义
|
||||
enum {
|
||||
P360_T0 = 0,
|
||||
P360_T1 = 1
|
||||
};
|
||||
|
||||
//混响算法定义
|
||||
enum {
|
||||
P360_R0 = 2,
|
||||
P360_R1 = 3
|
||||
};
|
||||
|
||||
enum {
|
||||
PSOUND_BOTH = 0,
|
||||
PSOUND_L = 1,
|
||||
PSOUND_R = 2
|
||||
};
|
||||
|
||||
enum {
|
||||
P360TD_NO_REV = 0,
|
||||
P360TD_REV_K0 = 1,
|
||||
P360TD_REV_K1 = 2,
|
||||
P360TD_REV_K3 = 3,
|
||||
P360TD_REV_K4 = 4
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct __PointSound360TD_FUNC_API_ {
|
||||
unsigned int (*need_buf)(int flag);
|
||||
unsigned int (*open)(unsigned int *ptr, PointSound360TD_PARM_SET *sound360_parm, PointSound360Reverb_PARM_SET *reverb_parm, int ch_mode);
|
||||
unsigned int (*init)(unsigned int *ptr, PointSound360TD_PARM_SET *sound360_parm);
|
||||
unsigned int (*run)(unsigned int *ptr, short *inbuf, short *out, int len); // len是sizePerChannel
|
||||
unsigned int (*open_config)(unsigned int *ptr, PointSound360TD_PARM_SET *sound360_parm, RP_PARM_CONIFG *sound360_configparm);
|
||||
} PointSound360TD_FUNC_API;
|
||||
|
||||
|
||||
|
||||
extern PointSound360TD_FUNC_API *get_PointSound360TD_func_api();
|
||||
|
||||
|
||||
#endif // reverb_api_h__
|
||||
15
include_lib/media/tech_lib/jlsp_vad.h
Normal file
15
include_lib/media/tech_lib/jlsp_vad.h
Normal file
@ -0,0 +1,15 @@
|
||||
/*****************************************************************
|
||||
>file name : jlsp_vad.h
|
||||
>create time : Fri 17 Dec 2021 02:18:47 PM CST
|
||||
*****************************************************************/
|
||||
#ifndef _JLSP_VAD_H_
|
||||
#define _JLSP_VAD_H_
|
||||
|
||||
int JLSP_vad_get_heap_size(void *file_ptr, int *model_size);
|
||||
void *JLSP_vad_init(char *heap_buffer, int heap_size, char *share_buffer, int share_size, void *file_ptr, int model_size);
|
||||
int JLSP_vad_reset(void *m);
|
||||
int JLSP_vad_process(void *m, short *pcm, int *out_flag);
|
||||
int JLSP_vad_free(void *m);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user