Opposite of "tee" or a way to merge two audio sources?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Opposite of "tee" or a way to merge two audio sources?

GStreamer-devel mailing list
Hello,

I've a pipeline which is reading from mic and sending audio information to a server:
gst-launch-1.0 alsasrc ! audioconvert ! vorbisenc ! oggmux ! shout2send mount=/stream.ogg port=8000 ip=localhost

That works great, however when there is no sound coming from the mic, I need to pipe a static file.

I can use cutter element (https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/html/gst-plugins-good-plugins-cutter.html) to detect silence, but how do I change the pipe to read from a file "uridecodebin uri=file:///path/to/audiofile" during silence and back to mic when it detects some audio?

Is there an element that is a reverse of a "tee" element which will allow me to merge two audio sources?

Thanks in advance.

Jayesh

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Opposite of "tee" or a way to merge two audio sources?

GStreamer-devel mailing list
It's not completely clear why you would want to merge the two audio sources in order to
switch between them, but you could use "audiomixer" or "input-selector", depending on
your use case. Strictly speaking, the opposite of a tee is a "funnel", but I doubt that is what
you're looking for here.

On 2/16/19 12:25 AM, Jayesh Dalal via gstreamer-devel wrote:
Hello,

I've a pipeline which is reading from mic and sending audio information to a server:
gst-launch-1.0 alsasrc ! audioconvert ! vorbisenc ! oggmux ! shout2send mount=/stream.ogg port=8000 ip=localhost

That works great, however when there is no sound coming from the mic, I need to pipe a static file.

I can use cutter element (https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/html/gst-plugins-good-plugins-cutter.html) to detect silence, but how do I change the pipe to read from a file "uridecodebin uri=file:///path/to/audiofile" during silence and back to mic when it detects some audio?

Is there an element that is a reverse of a "tee" element which will allow me to merge two audio sources?

Thanks in advance.

Jayesh

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Opposite of "tee" or a way to merge two audio sources?

GStreamer-devel mailing list
Hi Mathieu,

Thank you for your response and educating me about funnel. I researched
audiomixer and input-selector and looks like input-selector is what I am
after.

Think of the use case like a game show. First someone will speak in the mic,
announce the question, then there will be a pause for people to think about
the answer (mic still active but silence) and then an answer from the
announcer. During the silence, I wanted to play background music from a
file.

I was planning to use the cutter plugin to detect silence in the mic and
during that time play a pre-recorded music from a file. Once I detect sound
from the mic, I would stop the pre-recorded sound and switch the source back
to mic.

Please advice if there is a better way to handle that use case.

Jayesh



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Opposite of "tee" or a way to merge two audio sources?

GStreamer-devel mailing list
input-selector would work if your intention is for the buffers of the
inactive pad(s) to be dropped. In your case that means your background
music could be looped, and playback would resume at a "random" moment.

If your intention is for the background music to play back from the start during
the silence periods, you may want to use audiomixer instead, with dynamically
plugged-in sources, pad offsets and tweaking the volume of the live pad (the mic).

On 2/16/19 7:34 AM, jayeshdalal via gstreamer-devel wrote:

> Hi Mathieu,
>
> Thank you for your response and educating me about funnel. I researched
> audiomixer and input-selector and looks like input-selector is what I am
> after.
>
> Think of the use case like a game show. First someone will speak in the mic,
> announce the question, then there will be a pause for people to think about
> the answer (mic still active but silence) and then an answer from the
> announcer. During the silence, I wanted to play background music from a
> file.
>
> I was planning to use the cutter plugin to detect silence in the mic and
> during that time play a pre-recorded music from a file. Once I detect sound
> from the mic, I would stop the pre-recorded sound and switch the source back
> to mic.
>
> Please advice if there is a better way to handle that use case.
>
> Jayesh
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel