ecoacoustics / web-components

https://oe-web-components.netlify.app/
MIT License
1 stars 0 forks source link

BufferBuilderProcessor is re-created every spectrogram regeneration #144

Closed hudson-newey closed 1 month ago

hudson-newey commented 1 month ago

At the moment, the BufferBuilderProcessor re-creates itself every time a spectrogram is re-generated or the source changes. Additionally, every module the BufferBuilderProcessor depends on is re-instantiated every time a spectrogram is rendered.

This means that whenever the user is paging in the verification grid the a new BufferBuilderProcessor is created for every spectrogram for every page.

I propose that we treat it like the worker.ts, where we keep it active, then provide it new tasks every time it has new work.

We should also provide a lifetime to the processor so that it gets destroyed if not in-use for an extended period of time.

atruskie commented 1 month ago

We can't cache it. It's connected to the audio graph and the audio graph has to be recreated for every input.

With the web codec functionality, we'd be able to get rid of it.

Won't fix?