How to dynamically link a sound to audiomixer plugin ?

Nicolas Dufresne nicolas at ndufresne.ca
Wed Jan 10 17:35:41 UTC 2018


Le mercredi 10 janvier 2018 à 09:38 -0700, toub a écrit :
> 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 ?

In my own application, I solved this by adding "identify sync=1" after
wave parse. That will turn your filesource into a live source.

> 
> 
> 
> 
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180110/f33d825d/attachment.sig>


More information about the gstreamer-devel mailing list