DirectSound, Two devices with different frequency
Hi there,
There's a question about DirectSound. I wanna capture sound and play captured sound at the same time with the smallest latency. So I've got two buffers - sound and capture. I created N notification points in capture buffer and I'm trying to copy data from one buffer to another... But these buffers are owned by different devices. As everybody knows, there're not two equal frequency generators... so one buffer's always slower/faster than another. There're a lot of algorithms to manage this problems, they're called Sample Rate Convertors. They remove/add some samples from/to buffer, so difference between capturing and playing sound is getting to zero. But first of all I somehow should detect how many samples algorithm must add/remove... That makes a big problem for me.... How can I do it?
Thanks for suggestions.
Regards,
UVSoft.
|