cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
873
Views
1
Helpful
3
Replies

Best way to call EpStreamRead

denes.istvan
Level 1
Level 1

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

3 Replies 3

denes.istvan
Level 1
Level 1

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

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-

Thanks Mikhail,

this seems to help.

Regards,

Istvan