Skip to content

env~ runs expensive computations occasionally instead of spreading them across callbacks #103

Description

@giuliomoro

hvcc/generators/ir2c/static/HvSignalEnvelope.c

The inputs are stored in the internal buffer as squared, which is good, but the sum is performed all at once when the result is needed. This will cause a spike in CPU usage instead of having even CPU usage across all audio callbacks which would start causing dropouts while the average CPU usage is still low.

The sum should instead be computed incrementally at every callback. This would require adding a running sum variable per eachwindowSize/period element to the base struct.

I can look into implementing this, posting here ahead of that for any feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions