This project has moved and is read-only. For the latest updates, please go here.

Recording RTP Audio with gaps

Oct 14, 2014 at 2:59 AM
Edited Oct 14, 2014 at 3:00 AM
Hello and thank you in advance for your time.

We want to be able to record RTP audio into memory buffer of a certain length with the oldest audio be deleted once the buffer is full.

Lets say we want to hold 180 seconds of buffer, the rtp audio is not continuous, in any 180 second period there may only be 60 seconds of audio spread over the 180 seconds. Like listening to a two way radio.

At the moment if we have 20 seconds of audio, 20 seconds of silence, 20 seconds of audio. We have a buffer of 40 seconds of audio.

How would I go about inserting silence between the received audio?

Thanks again.
Oct 17, 2014 at 9:04 AM
Hi,

to add 20 seconds of silence I would add X number of zeros to the buffer, where

int X= 20 * (BitsPerSample / 8) * SampleRate;

Regards,
Isti