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 class kAudioStreamClassID
  • Undocumented

    Declaration

    Swift

    public override var debugDescription: String { get }
  • Returns true if the stream is active

    Remark

    This corresponds to the property kAudioStreamPropertyIsActive

    Declaration

    Swift

    public func isActive() throws -> Bool
  • Returns true if self is an output stream

    Remark

    This corresponds to the property kAudioStreamPropertyDirection

    Declaration

    Swift

    public func direction() throws -> Bool
  • Returns the terminal type

    Remark

    This corresponds to the property kAudioStreamPropertyTerminalType

    Declaration

    Swift

    public func terminalType() throws -> TerminalType
  • Returns the starting channel

    Remark

    This corresponds to the property kAudioStreamPropertyStartingChannel

    Declaration

    Swift

    public func startingChannel() throws -> PropertyElement
  • Returns the latency

    Remark

    This corresponds to the property kAudioStreamPropertyLatency

    Declaration

    Swift

    public func latency() throws -> UInt32
  • Returns the virtual format

    Remark

    This corresponds to the property kAudioStreamPropertyVirtualFormat

    Declaration

    Swift

    public func virtualFormat() throws -> AudioStreamBasicDescription
  • Sets the virtual format

    Remark

    This corresponds to the property kAudioStreamPropertyVirtualFormat

    Declaration

    Swift

    public func setVirtualFormat(_ value: AudioStreamBasicDescription) throws
  • Returns the available virtual formats

    Remark

    This corresponds to the property kAudioStreamPropertyAvailableVirtualFormats

    Declaration

    Swift

    public func availableVirtualFormats() throws -> [(AudioStreamBasicDescription, ClosedRange<Double>)]
  • Returns the physical format

    Remark

    This corresponds to the property kAudioStreamPropertyPhysicalFormat

    Declaration

    Swift

    public func physicalFormat() throws -> AudioStreamBasicDescription
  • Sets the physical format

    Remark

    This corresponds to the property kAudioStreamPropertyPhysicalFormat

    Declaration

    Swift

    public func setPhysicalFormat(_ value: AudioStreamBasicDescription) throws
  • Returns the available physical formats

    Remark

    This corresponds to the property kAudioStreamPropertyAvailablePhysicalFormats

    Declaration

    Swift

    public func availablePhysicalFormats() throws -> [(AudioStreamBasicDescription, ClosedRange<Double>)]
  • A thin wrapper around a HAL audio stream terminal type

    See more

    Declaration

    Swift

    public struct TerminalType : RawRepresentable, ExpressibleByIntegerLiteral, ExpressibleByStringLiteral
    extension AudioStream.TerminalType: CustomDebugStringConvertible
  • Returns true if self has selector

    Declaration

    Swift

    public func hasSelector(_ selector: AudioObjectSelector<AudioStream>) -> Bool

    Parameters

    selector

    The selector of the desired property

  • Returns true if selector is settable

    Throws

    An error if self does not have the requested property

    Declaration

    Swift

    public func isSelectorSettable(_ selector: AudioObjectSelector<AudioStream>) throws -> Bool

    Parameters

    selector

    The selector of the desired property

  • Registers block to be performed when selector changes

    Throws

    An error if the property listener could not be registered

    Declaration

    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