This project has moved. For the latest updates, please go here.

Recording RTP Audio with gaps

Oct 14, 2014 at 1:59 AM
Edited Oct 14, 2014 at 2: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 8:04 AM

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

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