SNDC_INTERLACE

NAME
SYNOPSIS
PROCESSING

NAME

interlace - Interlace input channels into one buffer.

SYNOPSIS

Inputs:

channel0 [BUFFER] [REQUIRED]: channel #0.

channel1 [BUFFER] [REQUIRED]: channel #1.

channel2 [BUFFER] [OPTIONAL]: channel #2.

channel3 [BUFFER] [OPTIONAL]: channel #3.

channel4 [BUFFER] [OPTIONAL]: channel #4.

channel5 [BUFFER] [OPTIONAL]: channel #5.

channel6 [BUFFER] [OPTIONAL]: channel #6.

channel7 [BUFFER] [OPTIONAL]: channel #7.

Outputs:

out [BUFFER]: interlaced output.

PROCESSING

interlace will interlace samples from all provided channels together. The main use case is to create a stereo audio signal by interlacing two channels.

The sequence of samples in the resulting buffer is as follows:

ch0[0] | ch1[0] | ch2[0] ... chn[0] | ch0[1] | ch1[1] | ch2[1] ...

In the particular case of two channels, channel0 will be the left one and channel1 will be the right one.

interlace will fail if sampling rates are not the same across all channels.

The output buffer will have a sampling rate set to the channel rate times the number of channels provided.

If a particular channel is shorter than the others, it is padded at the end with zeroes.

You can play (resp. export) the resulting buffer using sndc_play (resp sndc_export) by specifying the number of channels with the -c argument.