Declared in STMediaParams_doc.h

Overview

This struct describes the audio format of the codec used to convert recorded audio from one PCM format to another or to compress/decompress recorded audio to/from m4a files using AAC and ALAC codecs. Only AAC and ALAC codecs are supported.

A STAudioFormat object can be created as follows:

let audioFormat = STAudioFormat()

Tasks

  •   formatID

    The format ID. Valid format IDs are: “LINEARPCM”, “AAC” and “ALAC”.

      property
  •   commonFormat

    The requested common format for the “pcm” format ID.. Valid common formats are: “int16”, “int32”, “float32” and “float64”.

      property
  •   sampleRate

    The sampling rate that the audio converter will convert to.

      property
  •   channelCount

    The number of channels per audio sample. Default value: 1.

      property
  •   encoderBitsPerSample

    The number of bits per sample that the audio encoder. Relevant when encoding from linear PCM audio formats (common formats). Only used for ALAC. Ignored for LINEARPCM and when when encoding using AAC. Valid values are: 16, 20, 24 or 32 bits per sample.

      property
  •   encoderBitRate

    The bits per second for encoding audio when using compressed formats like AAC. Only used for AAC. Ignored for LINEARPCM and when encoding PCM using ALAC. Controls the quality and file size of the encoded audio. Higher bit rates → better audio quality, larger file size.

      property

Properties

channelCount

var channelCount: Int?

Discussion

The number of channels per audio sample. Default value: 1.

Declared In

STMediaParams_doc.h

commonFormat

var commonFormat: String?

Discussion

The requested common format for the “pcm” format ID.. Valid common formats are: “int16”, “int32”, “float32” and “float64”.

Declared In

STMediaParams_doc.h

encoderBitRate

var encoderBitRate: Int?

Discussion

The bits per second for encoding audio when using compressed formats like AAC. Only used for AAC. Ignored for LINEARPCM and when encoding PCM using ALAC. Controls the quality and file size of the encoded audio. Higher bit rates → better audio quality, larger file size.

Declared In

STMediaParams_doc.h

encoderBitsPerSample

var encoderBitsPerSample: Int?

Discussion

The number of bits per sample that the audio encoder. Relevant when encoding from linear PCM audio formats (common formats). Only used for ALAC. Ignored for LINEARPCM and when when encoding using AAC. Valid values are: 16, 20, 24 or 32 bits per sample.

Declared In

STMediaParams_doc.h

formatID

var formatID: String?

Discussion

The format ID. Valid format IDs are: “LINEARPCM”, “AAC” and “ALAC”.

Declared In

STMediaParams_doc.h

sampleRate

var sampleRate: Int?

Discussion

The sampling rate that the audio converter will convert to.

Declared In

STMediaParams_doc.h