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 g开发者_JS百科uy. 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!
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.
精彩评论