Reputation: 11
I've implemented a custom "sample grabber" filter for DirectShow. I grab samples with my host app, perform an FFT on it, and display the results via Direct3D.
The problem is there is nearly a 1 second delay between my visual result and when I hear the audio (the data is visualized before I hear it).
I've looked into it and the reason is that the default audio renderer has an internal one second buffer, as stated by this guy. He states that implementing either IAMBufferNegotiation or IAMPushSource should solve the problem. I have tried both and neither seem to make a difference.
I was curious if anyone else has had the same problem, and I want to make sure there is no other (easy) solution before I write my own audio renderer.
ALL input is appreciated!
Upvotes: 0
Views: 1500
Reputation: 567
Instead of changing the audio renderer filter's internal buffer size, you have to synchronize your drawing (rendering the result) with sample time stamps of the buffer that you calculated the FFT. You can use IReferenceClock::AdviseTime for the synchronization.
Upvotes: 1