Skip to content

SpectrogramGenerator: Support initializing with an existing list #36

Closed
@swharden

Description

@swharden

Content originally posted by @shirok1 in #33:


The loss of possibility to DIRECTLY use the reference of an external List<double>

The way you design this generator is for continuous or even real-time spectro drawing. In this case, make List<double> newAudio read-only, init as an empty one and .AddRange() later is the best solution. However, in my case, I need to use SG to generate the spectro for only once. Which means that as the Bitmap is generated, both the audio in ReadWAV and the newAudio in SG will immediately become garbage.

The Solution I come up with is this: An addition Optional Argument to init newAudio. It keeps the forward compatibility, but also enable me to prevent meaningless object creation (and later Grow into the same size as audio, which is the real problem).
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions