# audiomixmatrix

This element transforms a given number of input channels into a given number of output channels according to a given transformation matrix. The matrix coefficients must be between -1 and 1: the number of rows is equal to the number of output channels and the number of columns is equal to the number of input channels. In the first-channels mode, input/output channels are automatically negotiated and the transformation matrix is a truncated identity matrix.

## Example matrix generation code

To generate the matrix using code:

     GValue v = G_VALUE_INIT;
     GValue v2 = G_VALUE_INIT;
     GValue v3 = G_VALUE_INIT;

     g_value_init (&v2, GST_TYPE_ARRAY);
     g_value_init (&v3, G_TYPE_DOUBLE);
     g_value_set_double (&v3, 1);
     gst_value_array_append_value (&v2, &v3);
     g_value_unset (&v3);
     [ Repeat for as many double as your input channels - unset and reinit v3 ]
     g_value_init (&v, GST_TYPE_ARRAY);
     gst_value_array_append_value (&v, &v2);
     g_value_unset (&v2);
     [ Repeat for as many v2's as your output channels - unset and reinit v2]
     g_object_set_property (G_OBJECT (audiomixmatrix), "matrix", &v);
     g_value_unset (&v);

## Example launch line

     gst-launch-1.0 audiotestsrc ! audio/x-raw,channels=4 ! audiomixmatrix in-channels=4 out-channels=2 channel-mask=-1 matrix="<<(double)1, (double)0, (double)0, (double)0>, <0.0, 1.0, 0.0, 0.0>>" ! audio/x-raw,channels=2 ! autoaudiosink

## Hierarchy

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstBaseTransform
                        ╰──audiomixmatrix

## Factory details

Authors: – Vivia Nikolaidou <vivia@toolsonair.com></vivia@toolsonair.com>

Classification: – `Filter/Audio`

Rank – none

Plugin – audiomixmatrix

Package – GStreamer Bad Plug-ins

## Pad Templates

### `sink`

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

Presence – always

Direction – sink

Object type – GstPad

### `src`

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

Presence – always

Direction – src

Object type – GstPad

## Properties

### channel-mask

    “channel-mask” guint64

Output channel mask (-1 means "default for these channels")

Flags : Read / Write

Default value : 0

### in-channels

    “in-channels” guint

How many audio channels we have on the input side

Flags : Read / Write

Default value : 0

### matrix

    “matrix” GstValueArray *

Transformation matrix for input/output channels

Flags : Read / Write

### mode

    “mode” GstAudioMixMatrixModeType *

Whether to auto-negotiate input/output channels and matrix

Flags : Read / Write

Default value : manual (0)

### out-channels

    “out-channels” guint

How many audio channels we have on the output side

Flags : Read / Write

Default value : 0

## Named constants

### GstAudioMixMatrixModeType

#### Members

`manual` (0) – Manual mode: please specify input/output channels and transformation matrix
`first-channels` (1) – First channels mode: input/output channels are auto-negotiated, transformation matrix is a truncated identity matrix

The results of the search are