EZAudioDevice

@interface EZAudioDevice : NSObject

The EZAudioDevice provides an interface for getting the available input and output hardware devices on iOS and OSX. On iOS the EZAudioDevice uses the available devices found from the AVAudioSession, while on OSX the EZAudioDevice wraps the AudioHardware API to find any devices that are connected including the built-in devices (for instance, Built-In Microphone, Display Audio). Since the AVAudioSession and AudioHardware APIs are quite different the EZAudioDevice has different properties available on each platform. The EZMicrophone now supports setting any specific EZAudioDevice from the inputDevices function.

  • Provides the current EZAudioDevice that is being used to pull input. - returns: An EZAudioDevice instance representing the currently selected input device.

    Declaration

    Objective-C

    + (EZAudioDevice *)currentInputDevice;

    Swift

    class func currentInput() -> EZAudioDevice!

    Return Value

    An EZAudioDevice instance representing the currently selected input device.

  • Provides the current EZAudioDevice that is being used to output audio. - returns: An EZAudioDevice instance representing the currently selected ouotput device.

    Declaration

    Objective-C

    + (EZAudioDevice *)currentOutputDevice;

    Swift

    class func currentOutput() -> EZAudioDevice!

    Return Value

    An EZAudioDevice instance representing the currently selected ouotput device.

  • Enumerates all the available input devices and returns the result in an NSArray of EZAudioDevice instances. - returns: An NSArray containing EZAudioDevice instances, one for each available input device.

    Declaration

    Objective-C

    + (NSArray *)inputDevices;

    Swift

    class func inputDevices() -> [Any]!

    Return Value

    An NSArray containing EZAudioDevice instances, one for each available input device.

  • Enumerates all the available output devices and returns the result in an NSArray of EZAudioDevice instances. - returns: An NSArray of output EZAudioDevice instances.

    Declaration

    Objective-C

    + (NSArray *)outputDevices;

    Swift

    class func outputDevices() -> [Any]!

    Return Value

    An NSArray of output EZAudioDevice instances.

  • Enumerates all the available input devices. - iOS only - parameter: block When enumerating this block executes repeatedly for each EZAudioDevice found. It contains two arguments - first, the EZAudioDevice found, then a pointer to a stop BOOL to allow breaking out of the enumeration)

    Declaration

    Objective-C

    + (void)enumerateInputDevicesUsingBlock:(void (^)(EZAudioDevice *,
                                                      BOOL *))block;

    Parameters

    block

    When enumerating this block executes repeatedly for each EZAudioDevice found. It contains two arguments - first, the EZAudioDevice found, then a pointer to a stop BOOL to allow breaking out of the enumeration)

  • Enumerates all the available output devices. - iOS only - parameter: block When enumerating this block executes repeatedly for each EZAudioDevice found. It contains two arguments - first, the EZAudioDevice found, then a pointer to a stop BOOL to allow breaking out of the enumeration)

    Declaration

    Objective-C

    + (void)enumerateOutputDevicesUsingBlock:(void (^)(EZAudioDevice *,
                                                       BOOL *))block;

    Parameters

    block

    When enumerating this block executes repeatedly for each EZAudioDevice found. It contains two arguments - first, the EZAudioDevice found, then a pointer to a stop BOOL to allow breaking out of the enumeration)

  • An NSString representing a human-reable version of the device.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *name;

    Swift

    var name: String! { get }
  • An AVAudioSessionPortDescription describing an input or output hardware port. - iOS only

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) AVAudioSessionPortDescription *port;
  • An AVAudioSessionDataSourceDescription describing a specific data source for the port provided. - iOS only

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic)
        AVAudioSessionDataSourceDescription *dataSource;