Skip to content

Measuring the Data Thruput

Phil Schatzmann edited this page Jan 30, 2025 · 24 revisions

You can measure the data thurput with the help of the MeauringStream class. This class can be used as final output or in a chain both on the input or output side!

By default the result is reported in bytes per second if the frame size is not known and in frames per second if it is defined.

If you know the total (e.g. file) size, this class can also be used to estimate the total or open processing time based on the actual progress.

As Final Output

The thruput speed (in frames per second) is logged to serial after every 10 reads or writes:

AudioInfo info(44100, 2, 16)
MeasuringStream out(10, Serial);

void setup() {
  out.begin(info);
}

In a Processing Chain (on the Output Side)

The thruput speed (in frames per second) is logged to serial after every 10 reads or writes to out. The final data output goes to File.

AudioInfo info(44100, 2, 16)
File file
MeasuringStream out(file, 10, Serial);

void setup() {
  out.begin(info);
}
Clone this wiki locally