Help - Search - Members - Calendar
Full Version: Confusion over get_expected_latency's behavior
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
bleh
Hi, I was experimenting with the visualization SDK and ended up being completely baffled by get_expected_latency(). When I first saw the function, my thought was that it was there so I could have foobar delay the audio a bit so the visualization output would have time to process stuff and synch with it. However, I've found that if I return a value of around 0.015 seconds or higher, the visualization window stops redrawing the visualization unless I start doing stuff I'd expect to make Windows tell it to repaint (dragging it around, clicking it a lot, etc.). I've gotten this to happen just by defining get_expected_latency() in the test visualization in the SDK, so I'm pretty sure it wasn't just something my plugin was doing wrong, and playing with the visualization framerate settings didn't do anything. If this is the intended behavior, could someone please explain to me what I'm actually doing by defining get_expected_latency()? I feel like I missed something.

This happened to me with foobar2000 0.7.6 and 0.7.7 and with DirectSound and waveOut. I'm using Visual Studio .Net 2003 and Windows XP in case it matters.
Peter
Return negative values instead - they specify time offset of data you're getting, you can only get data earlier than actual sound, otherwise vis manager will drop packets before they reach you.
[edit] Another obvious limitation is that you can't get sound data earlier than it's decoded, so setting this to below about -0.5s might not work as expected either if user has exceptionally short buffer set.
bleh
Okay, that resolves everything, thanks!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.