r/rust • • Oct 26 '25

stft-rs, simple, streaming based STFT computing crate

Hey r/rust, just published an STFT crate based on rustfft. This was a side-rabbithole while implementing some model on Burn, which eventually became a simple library.

Contributions, feedback and criticism welcome!

https://github.com/wizenink/stft-rs

29 Upvotes

13 comments sorted by

View all comments

Show parent comment

2

u/words_number Oct 28 '25

It's not about performance/throuput but more about predictability. I know that in most situations on most systems these allocations will not even do a system call, but it is strictly forbidden to do anything potentially blocking on a realtime audio thread (e.g. in a VST plugin) for good reasons. No IO, no locks, no allocation. Even if that would result in WORSE throughout, it would be prefered for real time audio apps, because there are fewer unpredictable latency spikes.

2

u/wizenink Oct 28 '25

I researched a little bit after your comment. If you checkout the current implementation, there are some variants without allocation. If you find anything else that would be a no-no for realtime audio processing, I'll be more than glad to fix it :)