AudioCodecSettings

public struct AudioCodecSettings : Codable

The AudioCodecSettings class specifying audio compression settings.

  • The default value.

    Declaration

    Swift

    public static let `default`: AudioCodecSettings
  • Maximum number of channels supported by the system

    Declaration

    Swift

    public static let maximumNumberOfChannels: UInt32
  • Maximum sampleRate supported by the system

    Declaration

    Swift

    public static let mamimumSampleRate: Float64
  • Specifies the bitRate of audio output.

    Declaration

    Swift

    public var bitRate: Int
  • Specifies the sampleRate of audio output.

    Declaration

    Swift

    public var sampleRate: Float64
  • Specifies the channels of audio output.

    Declaration

    Swift

    public var channels: UInt32
  • Specifies the mixes the channels or not. Currently, it supports input sources with 4, 5, 6, and 8 channels.

    Declaration

    Swift

    public var downmix: Bool
  • Specifies the map of the output to input channels.

    Example code:

    // If you want to use the 3rd and 4th channels from a 4-channel input source for a 2-channel output, you would specify it like this.
    channelMap = [2, 3]
    

    Declaration

    Swift

    public var channelMap: [Int]?
  • Create an new AudioCodecSettings instance. A value of 0 will use the same value as the input source.

    Declaration

    Swift

    public init(
        bitRate: Int = 64 * 1000,
        sampleRate: Float64 = 0,
        channels: UInt32 = 0,
        downmix: Bool = false,
        channelMap: [Int]? = nil
    )