AudioStream
public class AudioStream : AudioObject
A HAL audio stream object
This class has a single scope (kAudioObjectPropertyScopeGlobal
), a master element (kAudioObjectPropertyElementMaster
), and an element for each channel
Remark
This class correponds to objects with base classkAudioStreamClassID
-
Undocumented
Declaration
Swift
public override var debugDescription: String { get }
-
Returns
true
if the stream is activeRemark
This corresponds to the propertykAudioStreamPropertyIsActive
Declaration
Swift
public func isActive() throws -> Bool
-
Returns
true
ifself
is an output streamRemark
This corresponds to the propertykAudioStreamPropertyDirection
Declaration
Swift
public func direction() throws -> Bool
-
Returns the terminal type
Remark
This corresponds to the propertykAudioStreamPropertyTerminalType
Declaration
Swift
public func terminalType() throws -> TerminalType
-
Returns the starting channel
Remark
This corresponds to the propertykAudioStreamPropertyStartingChannel
Declaration
Swift
public func startingChannel() throws -> PropertyElement
-
Returns the latency
Remark
This corresponds to the propertykAudioStreamPropertyLatency
Declaration
Swift
public func latency() throws -> UInt32
-
Returns the virtual format
Remark
This corresponds to the propertykAudioStreamPropertyVirtualFormat
Declaration
Swift
public func virtualFormat() throws -> AudioStreamBasicDescription
-
Sets the virtual format
Remark
This corresponds to the propertykAudioStreamPropertyVirtualFormat
Declaration
Swift
public func setVirtualFormat(_ value: AudioStreamBasicDescription) throws
-
Returns the available virtual formats
Remark
This corresponds to the propertykAudioStreamPropertyAvailableVirtualFormats
Declaration
Swift
public func availableVirtualFormats() throws -> [(AudioStreamBasicDescription, ClosedRange<Double>)]
-
Returns the physical format
Remark
This corresponds to the propertykAudioStreamPropertyPhysicalFormat
Declaration
Swift
public func physicalFormat() throws -> AudioStreamBasicDescription
-
Sets the physical format
Remark
This corresponds to the propertykAudioStreamPropertyPhysicalFormat
Declaration
Swift
public func setPhysicalFormat(_ value: AudioStreamBasicDescription) throws
-
Returns the available physical formats
Remark
This corresponds to the propertykAudioStreamPropertyAvailablePhysicalFormats
Declaration
Swift
public func availablePhysicalFormats() throws -> [(AudioStreamBasicDescription, ClosedRange<Double>)]
-
A thin wrapper around a HAL audio stream terminal type
See moreDeclaration
Swift
public struct TerminalType : RawRepresentable, ExpressibleByIntegerLiteral, ExpressibleByStringLiteral
extension AudioStream.TerminalType: CustomDebugStringConvertible
-
Returns
true
ifself
hasselector
Declaration
Swift
public func hasSelector(_ selector: AudioObjectSelector<AudioStream>) -> Bool
Parameters
selector
The selector of the desired property
-
Returns
true
ifselector
is settableThrows
An error ifself
does not have the requested propertyDeclaration
Swift
public func isSelectorSettable(_ selector: AudioObjectSelector<AudioStream>) throws -> Bool
Parameters
selector
The selector of the desired property
-
Registers
block
to be performed whenselector
changesThrows
An error if the property listener could not be registeredDeclaration
Swift
public func whenSelectorChanges(_ selector: AudioObjectSelector<AudioStream>, perform block: PropertyChangeNotificationBlock?) throws
Parameters
selector
The selector of the desired property
block
A closure to invoke when the property changes or
nil
to remove the previous value