Element that plays silence when stream stops?

Tim Müller tim at centricular.com
Wed Jul 6 13:02:42 UTC 2016


On Wed, 2016-07-06 at 13:13 +0200, marcin at saepia.net wrote:

Hi,

> I am developing an app in which I use shmsink/shmsrc to communicate
> between processes. They send audio to each other.
> 
> If data in the sender is not flowing (e.g. I fetch file over HTTP and
> the transfer is temporarily stopped) the shmsrc also stops, as
> there's no data to consume.
> 
> I would prefer that it keeps going and playing silence. Is there any
> element for this? (maybe audiorate?)

Simplest way might be to just do

 ... ! interaudiosink

interaudiosrc ! shmsink

(in which case interaudiosrc will keep producing silence even if you
stop feeding data into interaudiosink)

Other than what Nicolas already suggested, you could also write a
GstAudioSink baseclass that outputs data via shm, in that case the
audiosink/ringbuffer will keep writing silence samples if no data
arrives (assuming the pipeline stays in playing state).

Cheers
 -Tim

-- 

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


More information about the gstreamer-devel mailing list