STAudioFormat Struct Reference
| 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
-
formatIDpropertyThe format ID. Valid format IDs are: “LINEARPCM”, “AAC” and “ALAC”.
-
commonFormatpropertyThe requested common format for the “pcm” format ID.. Valid common formats are: “int16”, “int32”, “float32” and “float64”.
-
sampleRatepropertyThe sampling rate that the audio converter will convert to.
-
channelCountpropertyThe number of channels per audio sample. Default value: 1.
-
encoderBitsPerSamplepropertyThe 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.
-
encoderBitRatepropertyThe 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.
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