How to dynamically link a sound to audiomixer plugin ?
toub
etienne.laurent at pa.cotte.fr
Wed Jan 10 16:38:34 UTC 2018
Hi all,
I'm developing an app which mixes wav streams together, using the audiomixer
plugin.
I got an issue regarding dynamic linking of new filesrc elements to a
playing audiomixer element.
So far, what I do is :
- start a pipeline with only audiomixer->volume->audioconvert->alsasink
elements and put it in playing mode
- as soon as an event requesting sound streaming raises, I :
- instantiate new sound elements : filesrc->wavparse->audioconvert->pitch,
gathered in a bin
- link this bin to audiomixer, with a request pad retrieved by
gst_element_request_pad(audiomixer,
gst_element_class_get_pad_template(GST_ELEMENT_GET_CLASS(audiomixer),
"sink_%u"), NULL, NULL);
- retrieve running time :
gst_clock_get_time(gst_element_get_clock(pipeline)) -
gst_element_get_base_time(pipeline);
- apply running time as an offset on mixer sinkpad, so that new sound will
start from its beginning :
g_object_set(mixerSinkPad, "offset", RunningTime, NULL);
- put sound bin in playing mode
It works fine for first sound (when running time is at 0, no offset is
applied). However, if I trigger a new sound (before previous sound is ended,
hence before EOS is raised on bus), its beginning is truncated. I've tried
to apply a greater offset, with same result. I've also tried to pause
audiomixer or previous sound's bin before adding new sound, it does'nt
change anything.
Any Idea ?
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list