ChannelLayout

Memory layout for audio sample data.

Different audio processing libraries use different conventions for storing multi-channel audio data.

Entries

Link copied to clipboard

Single channel (mono) audio. Shape: samples

Link copied to clipboard

Interleaved multi-channel audio. Samples from different channels alternate: L R L R L R... Shape: samples, channels

Link copied to clipboard

Planar (non-interleaved) multi-channel audio. Each channel is stored contiguously: LLLL...RRRR... Shape: channels, samples

Link copied to clipboard

Batched interleaved audio. Shape: batch, samples, channels

Link copied to clipboard

Batched planar audio. Shape: batch, channels, samples

Properties

Link copied to clipboard

Index of the channels dimension in the shape array. Returns -1 for MONO (no channel dimension).

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard

Expected tensor rank for this layout.

Link copied to clipboard

Whether this layout includes a batch dimension.

Link copied to clipboard

Whether this layout is mono (single channel).

Link copied to clipboard

Whether channels are stored contiguously (planar).

Link copied to clipboard

Index of the samples dimension in the shape array.

Functions

Link copied to clipboard

Convert to batched version of this layout.

Link copied to clipboard

Convert to unbatched version of this layout.

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.