AudioStreamBasicDescription
extension AudioStreamBasicDescription
extension AudioStreamBasicDescription: Equatable
extension AudioStreamBasicDescription: CustomDebugStringConvertible
-
Common PCM formats
See moreDeclaration
Swift
public enum CommonPCMFormat
-
Initializes an
AudioStreamBasicDescription
for a common PCM variantDeclaration
Swift
public init(commonFormat format: CommonPCMFormat, sampleRate: Float64, channelsPerFrame: UInt32, isInterleaved interleaved: Bool)
Parameters
format
The desired common PCM variant
sampleRate
The audio sample rate
channelsPerFrame
The number of audio channels
isInterleaved
Whether the audio samples are interleaved
-
Returns
true
if this format is non-interleavedDeclaration
Swift
public var isNonInterleaved: Bool { get }
-
Returns
true
if this format is interleavedDeclaration
Swift
public var isInterleaved: Bool { get }
-
Returns the number of interleaved channels
Declaration
Swift
public var interleavedChannelCount: UInt32 { get }
-
Returns the number of channel streams
Declaration
Swift
public var channelStreamCount: UInt32 { get }
-
Returns the number of channels
Declaration
Swift
public var channelCount: UInt32 { get }
-
Returns
true
if this format is linear PCMDeclaration
Swift
public var isPCM: Bool { get }
-
Returns
true
if this format is big-endianDeclaration
Swift
public var isBigEndian: Bool { get }
-
Returns
true
if this format is little-endianDeclaration
Swift
public var isLittleEndian: Bool { get }
-
Returns
true
if this format is native-endianDeclaration
Swift
public var isNativeEndian: Bool { get }
-
Returns
true
if this format is floating-point linear PCMDeclaration
Swift
public var isFloat: Bool { get }
-
Returns
true
if this format is integer linear PCMDeclaration
Swift
public var isInteger: Bool { get }
-
Returns
true
if this format is signed integer linear PCMDeclaration
Swift
public var isSignedInteger: Bool { get }
-
Returns
true
if this format is packedDeclaration
Swift
public var isPacked: Bool { get }
-
Returns
true
if this format is high-alignedDeclaration
Swift
public var isAlignedHigh: Bool { get }
-
Returns
true
if this format is non-mixableNote
This flag is only used when interacting with HAL stream formatsDeclaration
Swift
public var isNonMixable: Bool { get }
-
Returns
true
if this format is mixableNote
This flag is only used when interacting with HAL stream formatsDeclaration
Swift
public var isMixable: Bool { get }
-
Returns the sample word size in bytes
Declaration
Swift
public var sampleWordSize: Int { get }
-
Returns the byte size of
frameCount
audio framesNote
This is equivalent toframeCount * mBytesPerFrame
Declaration
Swift
public func byteSize(forFrameCount frameCount: Int) -> Int
-
Returns the frame count of
byteSize
bytesNote
This is equivalent tobyteSize / mBytesPerFrame
Declaration
Swift
public func frameCount(forByteSize byteSize: Int) -> Int
-
Returns the equivalent non-interleaved format of
self
Note
This returnsnil
for non-PCM formatsDeclaration
Swift
public func nonInterleavedEquivalent() -> AudioStreamBasicDescription?
-
Returns the equivalent interleaved format of
self
Note
This returnsnil
for non-PCM formatsDeclaration
Swift
public func interleavedEquivalent() -> AudioStreamBasicDescription?
-
Returns the equivalent standard format of
self
Note
This returnsnil
for non-PCM formatsDeclaration
Swift
public func standardEquivalent() -> AudioStreamBasicDescription?
-
Resets
self
to the default stateDeclaration
Swift
public mutating func reset()
-
Declaration
Swift
public static func == (lhs: AudioStreamBasicDescription, rhs: AudioStreamBasicDescription) -> Bool
-
Declaration
Swift
public var debugDescription: String { get }