Fields (18) Methods (6) Properties (7)
Namespace: CSCore.DSP

Syntax

public class ChannelMatrix

Summary

Represents a channel conversion matrix. For more information, see .

Used by

Fields

FiveDotOneSurroundWithRearToMono

Defines a 5.1 surround (with rear) to mono channel conversion matrix.

public readonly ChannelMatrix FiveDotOneSurroundWithRearToMono

FiveDotOneSurroundWithRearToSevenDotOne

Defines a 5.1 surround (with rear) to 7.1 surround channel conversion matrix.

public readonly ChannelMatrix FiveDotOneSurroundWithRearToSevenDotOne

FiveDotOneSurroundWithRearToStereo

Defines a 5.1 surround (with rear) to stereo channel conversion matrix.

public readonly ChannelMatrix FiveDotOneSurroundWithRearToStereo

FiveDotOneSurroundWithSideToMono

Defines a 5.1 surround (with side) to mono channel conversion matrix.

public readonly ChannelMatrix FiveDotOneSurroundWithSideToMono

FiveDotOneSurroundWithSideToSevenDotOne

Defines a 5.1 surround (with side) to 7.1 surround channel conversion matrix.

public readonly ChannelMatrix FiveDotOneSurroundWithSideToSevenDotOne

FiveDotOneSurroundWithSideToStereo

Defines a 5.1 surround (with side) to stereo channel conversion matrix.

public readonly ChannelMatrix FiveDotOneSurroundWithSideToStereo

MonoToFiveDotOneSurroundWithRear

Defines a mono to 5.1 surround (with rear) channel conversion matrix.

public readonly ChannelMatrix MonoToFiveDotOneSurroundWithRear

MonoToFiveDotOneSurroundWithSide

Defines a mono to 5.1 surround (with side) channel conversion matrix.

public readonly ChannelMatrix MonoToFiveDotOneSurroundWithSide

MonoToSevenDotOneSurround

Defines a mono to 7.1 surround channel conversion matrix.

public readonly ChannelMatrix MonoToSevenDotOneSurround

MonoToStereoMatrix

Defines a mono to stereo conversion matrix.

public readonly ChannelMatrix MonoToStereoMatrix

SevenDotOneSurroundToFiveDotOneSurroundWithRear

Defines a 7.1 surround to 5.1 surround (with rear) channel conversion matrix

public readonly ChannelMatrix SevenDotOneSurroundToFiveDotOneSurroundWithRear

SevenDotOneSurroundToFiveDotOneSurroundWithSide

Defines a 7.1 surround to 5.1 surround (with side) channel conversion matrix

public readonly ChannelMatrix SevenDotOneSurroundToFiveDotOneSurroundWithSide

SevenDotOneSurroundToMono

Defines a 7.1 surround channel to mono conversion matrix.

public readonly ChannelMatrix SevenDotOneSurroundToMono

SevenDotOneSurroundToStereo

Defines a 7.1 surround to stereo channel conversion matrix.

public readonly ChannelMatrix SevenDotOneSurroundToStereo

StereoToFiveDotOneSurroundWithRear

Defines a stereo to 5.1 surround (with rear) channel conversion matrix.

public readonly ChannelMatrix StereoToFiveDotOneSurroundWithRear

StereoToFiveDotOneSurroundWithSide

Defines a stereo to 5.1 surround (with side) channel conversion matrix.

public readonly ChannelMatrix StereoToFiveDotOneSurroundWithSide

StereoToMonoMatrix

Defines a stereo to mono conversion matrix.

public readonly ChannelMatrix StereoToMonoMatrix

StereoToSevenDotOneSurround

Defines a stereo to 7.1 surround channel conversion matrix.

public readonly ChannelMatrix StereoToSevenDotOneSurround

Methods

ChannelMatrix(ChannelMask inputMask, ChannelMask outputMask)

Initializes a new instance of the ChannelMatrix class.

public void ChannelMatrix(ChannelMask inputMask, ChannelMask outputMask)

Parameters

inputMask

ChannelMask

The ChannelMask of the input signal.

outputMask

ChannelMask

The ChannelMask of the output signal.

Exceptions

ArgumentException

Invalid inputMask/outputMask.

Flip()

Flips the axis of the matrix and returns the new matrix with the flipped axis.

public ChannelMatrix Flip()

Returns

A matrix with flipped axis.

Remarks

This could be typically used in the following scenario: There is a 5.1 to stereo matrix. By using the Flip method the 5.1 to stereo matrix can be converted into a stereo to 5.1 matrix.

GetMatrix(ChannelMask from, ChannelMask to)

Gets a ChannelMatrix to convert between the two specified ChannelMasks.

public static ChannelMatrix GetMatrix(ChannelMask from, ChannelMask to)

Parameters

from

ChannelMask

The ChannelMask of the input stream.

to

ChannelMask

The desired ChannelMask of the output stream.

Returns

A ChannelMatrix to convert between the two specified ChannelMasks.

Exceptions

ArgumentException

from equals to

KeyNotFoundException

No accurate ChannelMatrix was found.

GetMatrix(WaveFormat from, WaveFormat to)

Gets a ChannelMatrix to convert between the two specified formats.

public static ChannelMatrix GetMatrix(WaveFormat from, WaveFormat to)

Parameters

from

WaveFormat

The input waveformat.

to

WaveFormat

The output waveformat.

Returns

A ChannelMatrix to convert between the two specified formats. If no channelmask could be found, the return value is null.

Exceptions

ArgumentException

The channelmask of the input format equals the channelmask of the output format.

KeyNotFoundException

No accurate ChannelMatrix was found.

CSCore.DSP.ChannelMatrixGetMatrixif (TryExtractChannelMask (from, out f) && TryExtractChannelMask (to, out t))GetMatrixendreturn ChannelMatrix

save

reset

Drag to pan - Use Mousewheel + Ctrl to zoom

GetOneDimensionalMatrix()

Returns a one dimensional array which contains the channel conversion matrix coefficients.

public Single[] GetOneDimensionalMatrix()

Returns

A one dimensional array which contains the channel conversion matrix coefficients

Remarks

This method is primarily used in combination with the SetUserChannelMtx method.

SetMatrix(Single[,] matrix)

Sets the channel conversion matrix. The x-axis of the matrix specifies the output channels. The y-axis of the matrix specifies the input channels.

public void SetMatrix(Single[,] matrix)

Parameters

matrix

Single[,]

Channel conversion matrix to use.

Properties

Height

Gets the number of rows of the channel conversion matrix.

public Int32 Height { get; }

InputChannelCount

Gets the input signals number of channels.

public Int32 InputChannelCount { get; }

Remarks

The InputChannelCount property always returns the same value as the Height property.

InputMask

Gets the ChannelMask of the input signal.

public ChannelMask InputMask { get; }

Item

Gets or sets a ChannelMatrixElement of the ChannelMatrix.

public ChannelMatrixElement Item { get; set; }

Parameters

input

The zero-based index of the input channel.

output

The zero-based index of the output channel.

Returns

The ChannelMatrixElement of the ChannelMatrix at the specified position.

OutputChannelCount

Gets the output signals number of channels.

public Int32 OutputChannelCount { get; }

Remarks

The OutputChannelCount property always returns the same value as the Width property.

OutputMask

Gets the ChannelMask of the output signal.

public ChannelMask OutputMask { get; }

Width

Gets the number of columns of the channel conversion matrix.

public Int32 Width { get; }