10-05-2015 01:39 AM
Hello,
so I need to read out a 8KHz, 16-bit G.711 u-law incoming audio format. What is a good algorithm to call EpStreamRead? Is there an event when I need to call this function? Or do I have to set up a timer (and with what period)?
Thanks,
Istvan
10-07-2015 03:11 AM
To make it a bit clear why I'm asking this question:
At the moment I call EpStreamRead every 10ms, and this way I've found out that the callback function with the sound data is called up every 20ms. The problem is that in the case my software has a minor freeze, and will fail to call the EpStreamRead and to handle the data that came with the Callback function. As a result, after the freeze is gone, I get a delay (depending on the freeze's length). How can I do this correctly, and how can I get rid of the incoming data's delay.
Thanks,
Istvan
10-07-2015 12:23 PM
Hi Istvan,
I am not aware of any specific delay in the RtpLib code.
Regarding "the best way to call EpReadStream" - you may want to call EpReadStream() from the Callback function after the previous buffer is processed. That way you should be able to read data with the speed that it comes and do not need to call EpStreamRead every 10ms or so from some other place / thread.
Regards,
-Mikhail-
10-15-2015 11:23 PM
Thanks Mikhail,
this seems to help.
Regards,
Istvan
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide