This project has moved. For the latest updates, please go here.

NAudio c2c FFT is very slow & Sync Wavestreams

Dec 22, 2014 at 11:54 AM
Hello Mark,

I encountered the problem that your FFT class seems to be quite slow, taking about ~200ms for each 4096 sample aggregation. I optimized my code for drawing and measured it: taking about 15ms with the Marshal and Lockbits method. I also recognized, that other FFT sizes, e.g. 1024 are significantly faster. So, do you look forward to optimize your FFT class one day? Or can you tell me a lightning fast .NET alternative for complex to complex FFT computation?

The second problem I struggle at, is to play Wavestreams on multiple devices at the same time and encounter delays that are clearly hearable. Especially when the Wavestream needs to decompress the samples. So, how can you synchronize several Wavestreams without too much delay und without interruptions in playback?

Kind regards

Freefall




About Flac Decoder news:



PS: Thefiloe in the end changed his mind, he said that his flac decoder may not be used in NAudio for an unknown reason. I can´t follow this small minded behaviour, I´m sorry for him.
He has already given permission and the plugin is finished now. So I let it published on google code. Anyway legit, as CSCore is MS-PL.
Coordinator
Dec 22, 2014 at 12:11 PM
hi Freefall,
FFT is computationally expensive. Make sure you are using a Release build. If you must get faster, then P/Invoking to something like FFTW may be an option. As for decoding on the fly, there will always be some latency involved in decoding, and also the buffer sizes of your output devices have an effect. For the best low latency, ASIO is usually the way to go, but can be harder to work with.

As for the FLAC decoder, a shame about the withdrawal of permission. I'll add a link to your project on google code, so people can use that if they want.

thanks
Mark