spdl.io.audio_encode_config

audio_encode_config(*, num_channels: int, sample_rate: int, sample_fmt: str = 'fltp', bit_rate: int = -1, compression_level: int = -1, qscale: int = -1) AudioEncodeConfig[source]

Customize encoding behavior.

Parameters:
  • num_channels – The number of channels.

  • sample_rate – The sample rate.

  • sample_fmt

    The sample format. This corresponds to channel order and data type.

    The following list shows the values for each data type.

    • "u8"; Unsigned 8-bit integer.

    • "s16": Signed 16-bit integer.

    • "s32": Signed 32-bit integer.

    • "flt": 32-bit floating point.

    • "dbl": 63-bit floating point.

    For planar format (a.k.a channel-first), suffix with "p".

    e.g.

    • "fltp": 32bit float, channel-first.

    • "s16": Signed 16-bit integer, channel-last.

  • bit_rate (int) – Optional Override bit rate.

  • compression_level (int) – Optional Override compression level.

  • sqcale (int) – Optional Override scale.