Talking clock - timestamp problem?

Tim Müller tim at centricular.com
Wed Aug 20 15:11:42 PDT 2014


On Wed, 2014-08-20 at 22:48 +0100, David Holroyd wrote:

Hi David,

I only had a cursory look at your setup, but here are some ideas /
things to try:

> On 18/08/14 22:11, David Holroyd wrote:
> > I am trying to build a pipeline something like a 'talking clock', 
> > continually
> > announcing the current date and time as test input to another system.
> >
> > The pipeline I've built in Ruby (bindings via gir_ffi) looks like:
> >
> >   appsrc ! festival ! wavparse ! audioconvert ! audioresample
> >     ! audio/x-raw,rate=48000,channels=2 ! audioconvert ! rtpL24pay
> >     ! udpsink
> 
> > If timestamps coming out of wavparse are the problem, is there a way 
> > to alter
> > the pipeline to fix this?
> 
> I inserted an identity element and used it's 'handoff' signal to add an 
> offset buffer.pts to account for the elapsed time between each utterance.
> 
> That does seem to smooth-out the sending of RTP packets, although it 
> feels a bit hacky.  Is there a better way?

Perhaps have two separate pipelines, connected via interaudiosink/src
elements:

  interaudiosrc ! ... ! rtpL24pay ! udpsink

and then

  appsrc ! festival ! wavparse ! ... ! interaudiosink

(where ... = audioconvert ! audioresample)

and then you just leave the rtp/udp one running, and restart the
festival/wavparse one as you please. When the festival one is not
running, interaudiosrc should be outputting silence.

Otherwise, there's also gst_pad_set_offset().

Cheers
 -Tim



-- 
Tim Müller, Centricular Ltd - http://www.centricular.com



More information about the gstreamer-devel mailing list