audiomixer

The audiomixer allows to mix several streams into one by adding the data. Mixed data is clamped to the min/max values of the data format.

Unlike the adder element audiomixer properly synchronises all input streams and also handles live inputs such as capture sources or RTP properly.

The audiomixer element can accept any sort of raw audio data, it will be converted to the target format if necessary, with the exception of the sample rate, which has to be identical to either what downstream expects, or the sample rate of the first configured pad. Use a capsfilter after the audiomixer element if you want to precisely control the format that comes out of the audiomixer, which supports changing the format of its output while playing.

If you want to control the manner in which incoming data gets converted, see the converter-config property, which will let you for example change the way in which channels may get remapped.

The input pads are from a GstPad subclass and have additional properties to mute each pad individually and set the volume:

  • "mute": Whether to mute the pad or not (#gboolean)
  • "volume": The volume of the pad, between 0.0 and 10.0 (#gdouble)

Example launch line

 gst-launch-1.0 audiotestsrc freq=100 ! audiomixer name=mix ! audioconvert ! alsasink audiotestsrc freq=500 ! mix.

This pipeline produces two sine waves mixed together.

Hierarchy

GObject
    ╰──GInitiallyUnowned
        ╰──GstObject
            ╰──GstElement
                ╰──GstAggregator
                    ╰──GstAudioAggregator
                        ╰──GstAudioMixer

Factory details

Authors: – Sebastian Dröge

Classification:Generic/Audio

Rank – none

Plugin – gstaudiomixer

Package – GStreamer Base Plug-ins

Pad Templates

sink_%u

audio/x-raw:
         format: { F64LE, F64BE, F32LE, F32BE, S32LE, S32BE, U32LE, U32BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, S16LE, S16BE, U16LE, U16BE, S8, U8 }
           rate: [ 1, 2147483647 ]
       channels: [ 1, 2147483647 ]
         layout: interleaved

Presencerequest

Directionsink

Object typeGstAudioMixerPad


src

audio/x-raw:
         format: { S32LE, U32LE, S16LE, U16LE, S8, U8, F32LE, F64LE }
           rate: [ 1, 2147483647 ]
       channels: [ 1, 2147483647 ]
         layout: interleaved

Presencealways

Directionsrc

Object typeGstAudioAggregatorConvertPad


Properties

alignment-threshold

“alignment-threshold” guint64

Timestamp alignment threshold in nanoseconds

Flags : Read / Write

Default value : 40000000


discont-wait

“discont-wait” guint64

Window of time in nanoseconds to wait before creating a discontinuity

Flags : Read / Write

Default value : 1000000000


latency

“latency” guint64

Additional latency in live mode to allow upstream to take longer to produce buffers for the current position (in nanoseconds)

Flags : Read / Write

Default value : 0


min-upstream-latency

“min-upstream-latency” guint64

When sources with a higher latency are expected to be plugged in dynamically after the aggregator has started playing, this allows overriding the minimum latency reported by the initial source(s). This is only taken into account when larger than the actually reported minimum latency. (nanoseconds)

Flags : Read / Write

Default value : 0


output-buffer-duration

“output-buffer-duration” guint64

Output block size in nanoseconds

Flags : Read / Write

Default value : 10000000


output-buffer-duration-fraction

“output-buffer-duration-fraction” GstFraction *

Output block size in nanoseconds, expressed as a fraction

Flags : Read / Write

Default value : 1/100


start-time

“start-time” guint64

Start time to use if start-time-selection=set

Flags : Read / Write

Default value : 18446744073709551615


start-time-selection

“start-time-selection” GstAggregatorStartTimeSelection *

Decides which start time is output

Flags : Read / Write

Default value : zero (0)


The results of the search are