How do I reach audioTestBench -> audioFileR?eader.Samp?lesPerFram?e for use in my plugin?

Illustration
Johansen - 2021-12-27T13:02:00+00:00
Question: How do I reach audioTestBench -> audioFileR?eader.Samp?lesPerFram?e for use in my plugin?

I'm creating a Real-Time frame-based plugin with the System Audio Toolbox, to run through the audioTestBench. In the audioTestBench the input is set to "Audio File Reader" or "Audio Device Reader" depending on my current setup. This allows me to specify the desired number of samples per frame, a number that is relevant for the frame-based plugin code, however I'm unable to read the samples per frame into the plugin code?     Using the function "getSamplesPerFrame(audioPluginSource)" always returns the default value 256, since I'm not using "setSamplesPerFrame" to define the frame size.     So my question is, how do I reach the instance of e.g. "dsp.AudioFileReader" that is used within the UI of the audioTestBench, such that is can read the specified samples per frame within the plugin?

Expert Answer

Profile picture of Neeta Dsouza Neeta Dsouza answered . 2025-11-20

There is no programmatic interface to the Audio Test Bench UI. However, you could obtain the SamplesPerFrame property of dsp.AudioFileReader by calculating the size of the input data to the 'process()' method. For example, the source code of the Audio Test Bench could be edited to include:

 

classdef myEchoPlugin < audioPlugin
     methods
        function out = process(plugin,in)
        spf = size(in,1);
        out = in;
        end
     end
end

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!