嵌入式音频架构 - AudioWeaver模块开发

本文介绍了AudioWeaver的模块开发流程,涉及Matlab配置控制、模块描述、实例数据结构、类ID、构造函数和核心函数。开发过程包括使用Matlab生成代码,VisualStudio编译DLL,以及Server通过类ID或模块名控制模块。
摘要由CSDN通过智能技术生成

AudioWeaver的新模块开发需要Matlab,VisualStudio,server,硬件平台,嵌入式开发IDE。

在这里插入图片描述
AudioWeaver在PC端主要依靠的就是Matlab来配置和控制,Matlab提供接口可以进行参数计算,可视化,自动化,测试,以及系统的编译。同时负责描述模块,生成代码,生成文档。
每个AW 模块都有一个关联的Matlab M文件,其中包含了模块的描述信息,包括

  1. I/O pin描述: 数据类型,通道数,block size,采样率
  2. 结构变量: 数据类型,变量名,array size, memory分配要求
  3. 文档信息:变量描述,pin描述,模块描述
  4. 链接到inner c代码:process,set,bypass,get函数
  5. 用户接口:control信号接口
  6. AWE designer 描述信息

每个模块都有一个instance data structure来保存变量,包括state 和parameters变量。instance data structure包含在模块头文件中module.h
这个头文件是有AW自动生成的。

typedef struct _awe_modScalerSmoothedExampleInstance
{
   
ModuleInstanceDescriptor instance;
float gain; // Target gain
float smoothingTime; // Time constant of the ...
float currentGain; // Instantaneous gain applied
...
float smoothingCoeff; // Smoothing coefficient
} awe_modScalerSmoothedExampleInstance;

在开头包含了一个子结构体 ModuleInstanceDescriptor instance,其中指向模块的I/O pin,实时函数(processing,Bypass,Muted,…),类结构。定义在

<AWE>\Include\Framework.h.

里面还有模块instance描述结构:

typedef struct _ModuleInstanceDescriptor
{
   
ModInstanceDescriptor instanceDescriptor;
struct _LayoutInstance *pOwner;
UINT packedFlags;
float profile_time;
WireInstance **pWires;
void (*pProcessFunc)(void *pInstance);
}
ModuleInstanceDescriptor;

typedef struct _WireInstance
{
   
/** The basic instance data. */
InstanceDescriptor instanceDescriptor;
/** The pin descriptor describing this wire. */
PinInstanceDescriptor *pPinDescriptor;
/** The wire buffer. */
Sample *buffer;
}
WireInstance;

头文件中还包含了模块配置变量的bit mask宏, 偏移宏 和 类ID。
Server可以通过类ID来新建一个模块在siganlflow中。每个模块的类ID都是唯一的。

#
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值