multi audio track combine

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

multi audio track combine

Richard
Hi All,

Is there a component that is capable of combining/mixing multiple
audio tracks in to one? I am reading audio from multiple ALSA devices
and need to combine in to one stream and then output to multiple audio
sinks.


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

Re: multi audio track combine

Tim-Philipp Müller-2
On Sat, 2012-08-18 at 17:43 +0100, Richard wrote:

> Is there a component that is capable of combining/mixing multiple
> audio tracks in to one? I am reading audio from multiple ALSA devices
> and need to combine in to one stream and then output to multiple audio
> sinks.

Perhaps the "adder" element is what you're looking for? If not, maybe
the interleave element?

Cheers
-Tim

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

Re: multi audio track combine

Richard
On 18 August 2012 20:23, Tim-Philipp Müller <[hidden email]> wrote:

> On Sat, 2012-08-18 at 17:43 +0100, Richard wrote:
>
>> Is there a component that is capable of combining/mixing multiple
>> audio tracks in to one? I am reading audio from multiple ALSA devices
>> and need to combine in to one stream and then output to multiple audio
>> sinks.
>
> Perhaps the "adder" element is what you're looking for? If not, maybe
> the interleave element?
>
> Cheers
> -Tim
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

Thanks Tim,

I tried the interleave component but it wasn't very intuitive on its
usage.  I  will  take a look at adder

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

Re: multi audio track combine

Janardhan Reddy
In reply to this post by Tim-Philipp Müller-2

is there any component which enables combining one audio with some part of another audio into one stream. for example only 10 min of second audio follows first audio


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

Re: multi audio track combine

Emile Semmes
In reply to this post by Tim-Philipp Müller-2
On 8/18/2012 12:23 PM, Tim-Philipp Müller wrote:

> On Sat, 2012-08-18 at 17:43 +0100, Richard wrote:
>
>> Is there a component that is capable of combining/mixing multiple
>> audio tracks in to one? I am reading audio from multiple ALSA devices
>> and need to combine in to one stream and then output to multiple audio
>> sinks.
> Perhaps the "adder" element is what you're looking for? If not, maybe
> the interleave element?
>
> Cheers
> -Tim
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Tim,

You beat me to the punch. I second using adder too.

Can you just have a pipeline from one alsasrc directly to the alsasink
or do you need something like an output-selector for dynamic alsasink
selection? Is this on the same device for immediate playback or can you
save this to a file for later playback? There are a couple of ways to
skin this cat.

Note: these are prototype pipelines. I haven't tested them.

Assuming you're using multichannel inputs, you could try using the
interleave and deinterleave elements but that's kinda hackish
alsasrc device="hw:1,0" ! deinterleave name=d1 \
alsasrc device="hw:1,1" ! deinterleave name=d2 \
interleave name=i \
d1.src0 ! i.sink0 \
d1.src1 ! i.sink1 \
d2.src0 ! i.sink2 \
d3.src1 ! i.sink3
... and then the reverse to get to your alsasink. If you need to swap
inputs to outputs, you'll have to throw in output-selectors. That's
going to be a pretty complex pipeline, but it may do the trick. (This
actually sounds like fun. Let me know if you need help doing this one)


For later playback, if you can mux them into a quicktime container. Your
pipeline would look something like:

alsasrc device="hw:1,0" ! queue ! mux.audio_00 \
alsasrc device="hw:1,1" ! queue ! mux.audio_01 \
alsasrc device="hw:1,2" ! queue ! mux.audio_02 \
qtmux name=mux ! filesink

You might have to do some tricks with qtmux so you can play it back.
qtdemux was complaining about an empty atom during demuxing.

Have fun,
Emile

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

Re: multi audio track combine

Richard

Thanks all,

The scenario is odd...  Its a intercom with some funky features.

3 ALSA inputs/outputs for headsets/microphones, all audio from all microphones should go to all earpieces.

There is one special case input; A microphone is placed in the ambient noise (in an aircraft)
The audio is inverted and added to the other 3 headset outputs - this should give Active noise cancellation; or some effect close to it.

It is easier to do using discrete op-amps, but this is more fun :D

Richard

On Aug 19, 2012 8:03 AM, "Emile Semmes" <[hidden email]> wrote:
On 8/18/2012 12:23 PM, Tim-Philipp Müller wrote:
On Sat, 2012-08-18 at 17:43 +0100, Richard wrote:

Is there a component that is capable of combining/mixing multiple
audio tracks in to one? I am reading audio from multiple ALSA devices
and need to combine in to one stream and then output to multiple audio
sinks.
Perhaps the "adder" element is what you're looking for? If not, maybe
the interleave element?

Cheers
-Tim

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

You beat me to the punch. I second using adder too.

Can you just have a pipeline from one alsasrc directly to the alsasink or do you need something like an output-selector for dynamic alsasink selection? Is this on the same device for immediate playback or can you save this to a file for later playback? There are a couple of ways to skin this cat.

Note: these are prototype pipelines. I haven't tested them.

Assuming you're using multichannel inputs, you could try using the interleave and deinterleave elements but that's kinda hackish
alsasrc device="hw:1,0" ! deinterleave name=d1 \
alsasrc device="hw:1,1" ! deinterleave name=d2 \
interleave name=i \
d1.src0 ! i.sink0 \
d1.src1 ! i.sink1 \
d2.src0 ! i.sink2 \
d3.src1 ! i.sink3
... and then the reverse to get to your alsasink. If you need to swap inputs to outputs, you'll have to throw in output-selectors. That's going to be a pretty complex pipeline, but it may do the trick. (This actually sounds like fun. Let me know if you need help doing this one)


For later playback, if you can mux them into a quicktime container. Your pipeline would look something like:

alsasrc device="hw:1,0" ! queue ! mux.audio_00 \
alsasrc device="hw:1,1" ! queue ! mux.audio_01 \
alsasrc device="hw:1,2" ! queue ! mux.audio_02 \
qtmux name=mux ! filesink

You might have to do some tricks with qtmux so you can play it back. qtdemux was complaining about an empty atom during demuxing.

Have fun,
Emile

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

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