docs/doc/reference/com/google/android/exoplayer2/audio/ChannelMixingMatrix.html
Package com.google.android.exoplayer2.audio
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classChannelMixingMatrixextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
An immutable matrix that describes the mapping of input channels to output channels.
The matrix coefficients define the scaling factor to use when mixing samples from the input channel (row) to the output channel (column).
Examples:
[0.5 0.5]
[1 0
0 1]
[0.7 0
0 0.7]
Constructors | Constructor | Description |
| --- | --- |
| ChannelMixingMatrix(int inputChannelCount, int outputChannelCount, float[] coefficients) |
Deprecated.
Creates a matrix with the given coefficients in row-major order. |
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| static ChannelMixingMatrix | create(int inputChannelCount, int outputChannelCount) |
Deprecated.
Creates a standard channel mixing matrix that converts from inputChannelCount channels to outputChannelCount channels.
|
| int | getInputChannelCount() |
Deprecated.
|
| float | getMixingCoefficient(int inputChannel, int outputChannel) |
Deprecated.
Gets the scaling factor for the given input and output channel.
|
| int | getOutputChannelCount() |
Deprecated.
|
| boolean | isDiagonal() |
Deprecated.
Returns whether the matrix is square and all non-diagonal coefficients are zero.
|
| boolean | isIdentity() |
Deprecated.
Returns whether this is an identity matrix.
|
| boolean | isSquare() |
Deprecated.
Returns whether the input and output channel count is the same.
|
| boolean | isZero() |
Deprecated.
Returns whether all mixing coefficients are zero.
|
| ChannelMixingMatrix | scaleBy(float scale) |
Deprecated.
Returns a new matrix with the given scaling factor applied to all coefficients. |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public ChannelMixingMatrix(int inputChannelCount,
int outputChannelCount,
float[] coefficients)
Deprecated.
Creates a matrix with the given coefficients in row-major order.
Parameters:inputChannelCount - Number of input channels (rows in the matrix).outputChannelCount - Number of output channels (columns in the matrix).coefficients - Non-negative matrix coefficients in row-major order.
-
public static[ChannelMixingMatrix](ChannelMixingMatrix.html "class in com.google.android.exoplayer2.audio")create(int inputChannelCount,
int outputChannelCount)
Deprecated.
Creates a standard channel mixing matrix that converts from inputChannelCount channels to outputChannelCount channels.
If the input and output channel counts match then a simple identity matrix will be returned. Otherwise, default matrix coefficients will be used to best match channel locations and overall power level.
Parameters:inputChannelCount - Number of input channels.outputChannelCount - Number of output channels.Returns:New channel mixing matrix.Throws:UnsupportedOperationException - If no default matrix coefficients are implemented for the given input and output channel counts.
-
public int getInputChannelCount()
Deprecated.
-
public int getOutputChannelCount()
Deprecated.
-
public float getMixingCoefficient(int inputChannel,
int outputChannel)
Deprecated.
Gets the scaling factor for the given input and output channel.
-
public boolean isZero()
Deprecated.
Returns whether all mixing coefficients are zero.
-
public boolean isSquare()
Deprecated.
Returns whether the input and output channel count is the same.
-
public boolean isDiagonal()
Deprecated.
Returns whether the matrix is square and all non-diagonal coefficients are zero.
-
public boolean isIdentity()
Deprecated.
Returns whether this is an identity matrix.
-
public[ChannelMixingMatrix](ChannelMixingMatrix.html "class in com.google.android.exoplayer2.audio")scaleBy(float scale)
Deprecated.
Returns a new matrix with the given scaling factor applied to all coefficients.