This project has moved and is read-only. For the latest updates, please go here.

Seting WaveOut buffersize directly to a number of samples

Oct 11, 2015 at 10:45 PM
Edited Oct 11, 2015 at 10:46 PM
Hi, I want to use a pitch shifting algotihm that transposes Samples in high quality. I created a SampleProvider and pass the buffer to the FFT function then, but have the problem, that the FFT function desires a size of 1024, 2048, 4096 etc. that doesn´t match the count of the read method, which is 4410 (NumBuffers=3, Latency=150ms). So if i take a FFT Size of 4096 i still miss some frames (314), which lowers quality very much.

Is there any workaround to read in FFTSize blocks and still ensure a gapless and smooth playback? I mean instead of setting it up through the waveout device, which actually isn´t supported.

Many thanks, Freefall.
Oct 12, 2015 at 8:47 PM
You don't always get the chance to specify the exact size of sound-card buffers. My solution to this which you can see in the WPF demo I think was the SampleAggregator, which buffered up audio and when it got say 4096 samples, it calculated the FFT and raised an event. This makes it irrelevant what size the buffers are.
Oct 15, 2015 at 10:38 PM
Hey Mark, thanks this is a good idea. I´ll try that :)
Oct 17, 2015 at 12:18 PM
Ok I tested it and it doesn´t work. This just puts the missed samples to next read iteration and so on...

I`m very unhappy with this solution. A in-place pitch shifting of exactly each iteration of read would be best.
Oct 28, 2015 at 1:44 PM
Well if you need exact control of the buffer sizes, then I suggest working with ASIO, which is much easier to control.
Nov 6, 2015 at 7:00 PM
No solution for me either, as I as well as many others, don´t have asio drivers installed.

For best compability to the system I want to stay on WaveOut. I wonder that it isn´t possible to set a buffer size here.