Hi DSPC Community,
I'm working on custom module development in Audio Weaver, where I need my module to accept an input block size of 1532 x 1 and produce an output block size of 1536 x 4. I used the preBuild function in MATLAB to declare the input and output properties of the module . However, I'm encountering the following error during the build process:
MATLAB Script:
% ----------------------------------------------------------------------
% Prebuild Function
% ----------------------------------------------------------------------
function M=custom_module_prebuild_func(M)
M.inputPin{1}.type.numChannels=1;
M.inputPin{1}.type.blockSize=1532;
M.outputPin{1}.type.sampleRate=48000;
M.outputPin{1}.type.numChannels=4;
M.outputPin{1}.type.dataType=M.inputPin{1}.type.dataType;
M.outputPin{1}.type.blockSize=1536;
return;
11:12am
Hi Monika,
Generally speaking, if the input and output block sizes are fixed, I would simply put those code lines in the body of the main matlab function rather than the prebuild function.
In addition, you have to make sure to declare your prebuild function in the main part of your code.
Have you put a breakpoint on your prebuild function to make sure it is getting executed?
Gary
5:07am
Hi Gary ,
Thank you for the response.
We tried the steps which you mentioned above.
Please find the output behaviour :
Q - Have you put a breakpoint on your prebuild function to make sure it is getting executed?
A - yes it executed and the output block-size value updated in the instance properties but not reflected in the output wire properties in the AWE design( block-size remains as same as input). Please find the updated output pin type properties. screenshot_from_2025-03-24_14-07-27.png
Note: Output block-size needs to be different from input block-size.
Thanks,
Monika
1:58pm
Hi Monika,
I created a new custom module and added the prebuild function as shown below. This changes the module's output blocksize to 67. Let me know if this works for you.
Thanks,
Gary