Class anira::LiteRtProcessor#

class LiteRtProcessor : public anira::BackendBase#

Inheritance diagram for anira::LiteRtProcessor:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "2" [label="anira::BackendBase" tooltip="anira::BackendBase"]
    "1" [label="anira::LiteRtProcessor" tooltip="anira::LiteRtProcessor" fillcolor="#BFBFBF"]
    "1" -> "2" [dir=forward tooltip="public-inheritance"]
}

Collaboration diagram for anira::LiteRtProcessor:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "2" [label="anira::BackendBase" tooltip="anira::BackendBase"]
    "3" [label="anira::InferenceConfig" tooltip="anira::InferenceConfig"]
    "1" [label="anira::LiteRtProcessor" tooltip="anira::LiteRtProcessor" fillcolor="#BFBFBF"]
    "5" [label="anira::ModelData" tooltip="anira::ModelData"]
    "4" [label="anira::ProcessingSpec" tooltip="anira::ProcessingSpec"]
    "6" [label="anira::TensorShape" tooltip="anira::TensorShape"]
    "2" -> "3" [dir=forward tooltip="usage"]
    "3" -> "4" [dir=forward tooltip="usage"]
    "3" -> "5" [dir=forward tooltip="usage"]
    "3" -> "6" [dir=forward tooltip="usage"]
    "1" -> "2" [dir=forward tooltip="public-inheritance"]
}

LiteRT-based neural network inference processor.

The LiteRtProcessor class provides neural network inference using Google’s LiteRT native C API (the LiteRt* CompiledModel API). LiteRT is the rebranded successor to TensorFlow Lite and runs the same .tflite models; this backend uses LiteRT’s newer native API rather than the legacy TfLite* C API used by TFLiteProcessor.

The LiteRT state lives behind the named pimpl Instance, defined only in LiteRtProcessor.cpp: this header includes no engine header (see BackendBase).

Warning

This class is only available when compiled with USE_LITERT defined

Public Functions

LiteRtProcessor(InferenceConfig &inference_config)#

Constructs a LiteRT processor with the given inference configuration.

Initializes the LiteRT processor and creates the necessary number of parallel processing instances based on the configuration’s num_parallel_processors setting.

Parameters:

inference_config – Reference to inference configuration containing model path, tensor shapes, and processing parameters

~LiteRtProcessor() override#

Destructor that properly cleans up LiteRT resources.

virtual void prepare() override#

Prepares all LiteRT instances for inference operations.

virtual void process(std::vector<BufferF> &input, std::vector<BufferF> &output, std::shared_ptr<SessionElement> session) override#

Processes input buffers through the LiteRT model.

Parameters:
  • input – Vector of input buffers containing audio samples or parameter data

  • output – Vector of output buffers to receive processed results

  • session – Shared pointer to session element providing thread-safe instance access