com.avaya.deskphoneservices.device

## Class AudioDeviceUtil

- java.lang.Object
- - com.avaya.deskphoneservices.device.AudioDeviceUtil

-     public final class AudioDeviceUtil
      extends java.lang.Object

  Miscellaneous utility methods for dealing with `AudioDevice` objects.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static com.avaya.clientservices.media.AudioDevice` | `getAudioDeviceForHandset(HandsetType handset, java.lang.Iterable<com.avaya.clientservices.media.AudioDevice> audioDevices)` Find the available `AudioDevice` instance for a given `HandsetType`.
    `static com.avaya.clientservices.media.AudioDevice` | `getAudioDeviceOfType(com.avaya.clientservices.media.AudioDevice.Type desiredType, java.lang.Iterable<com.avaya.clientservices.media.AudioDevice> audioDevices)` Find the available `AudioDevice` instance of a given `AudioDevice.Type`.
    `static com.avaya.clientservices.media.AudioDevice.Type` | `getAudioDeviceTypeForHandset(HandsetType handset)` Get the `AudioDevice.Type` for a given `HandsetType`.
    `static HandsetType` | `getHandsetTypeForAudioDevice(com.avaya.clientservices.media.AudioDevice device)` Get the `HandsetType` of the given audio device.
    `static HandsetType` | `getHandsetTypeForAudioDeviceType(com.avaya.clientservices.media.AudioDevice.Type deviceType)` Get the `HandsetType` corresponding to the given audio device type.
    `static com.avaya.clientservices.media.AudioDevice` | `getSpeakerAudioDevice(java.lang.Iterable<com.avaya.clientservices.media.AudioDevice> audioDevices)` Find the `AudioDevice` for the built-in speakerphone.
    `static boolean` | `isAudioDeviceForHandset(com.avaya.clientservices.media.AudioDevice audioDevice, HandsetType handset)` Is the given audio device of the type matching the given handset type?

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getAudioDeviceForHandset

          @Nullable
          public static com.avaya.clientservices.media.AudioDevice getAudioDeviceForHandset(@NonNull
                                                                                                      HandsetType handset,
                                                                                                      @NonNull
                                                                                                      java.lang.Iterable<com.avaya.clientservices.media.AudioDevice> audioDevices)

      Find the available `AudioDevice` instance for a given `HandsetType`.
      Parameters:
        `handset` - The type of handset in question.
        `audioDevices` - The available audio devices reported by the media engine.
      Returns:
        The matching audio device if any, `null` if no match.

    - #### getAudioDeviceOfType

          @Nullable
          public static com.avaya.clientservices.media.AudioDevice getAudioDeviceOfType(@NonNull
                                                                                                  com.avaya.clientservices.media.AudioDevice.Type desiredType,
                                                                                                  @NonNull
                                                                                                  java.lang.Iterable<com.avaya.clientservices.media.AudioDevice> audioDevices)

      Find the available `AudioDevice` instance of a given `AudioDevice.Type`.
      Parameters:
        `desiredType` - The type of audio device to find.
        `audioDevices` - The available audio devices reported by the media engine.
      Returns:
        The matching audio device if any, `null` if no match.

    - #### getSpeakerAudioDevice

          @NonNull
          public static com.avaya.clientservices.media.AudioDevice getSpeakerAudioDevice(@NonNull
                                                                                                  java.lang.Iterable<com.avaya.clientservices.media.AudioDevice> audioDevices)

      Find the `AudioDevice` for the built-in speakerphone.
      Parameters:
        `audioDevices` - The available audio devices reported by the media engine.
      Returns:
        The speakerphone audio device instance.

    - #### getAudioDeviceTypeForHandset

          @NonNull
          public static com.avaya.clientservices.media.AudioDevice.Type getAudioDeviceTypeForHandset(@NonNull
                                                                                                              HandsetType handset)

      Get the `AudioDevice.Type` for a given `HandsetType`.
      Parameters:
        `handset` - The type of handset in question.
      Returns:
        The handset's corresponding audio device type.

    - #### getHandsetTypeForAudioDevice

          @Nullable
          public static HandsetType getHandsetTypeForAudioDevice(@NonNull
                                                                           com.avaya.clientservices.media.AudioDevice device)

      Get the `HandsetType` of the given audio device.
      Parameters:
        `device` - The audio device in question.
      Returns:
        The corresponding `HandsetType` if there is one, otherwise `null`.

    - #### getHandsetTypeForAudioDeviceType

          @Nullable
          public static HandsetType getHandsetTypeForAudioDeviceType(@NonNull
                                                                               com.avaya.clientservices.media.AudioDevice.Type deviceType)

      Get the `HandsetType` corresponding to the given audio device type.
      Parameters:
        `deviceType` - The audio device type in question.
      Returns:
        The corresponding `HandsetType` if there is one, otherwise `null`.

    - #### isAudioDeviceForHandset

          public static boolean isAudioDeviceForHandset(@NonNull
                                                        com.avaya.clientservices.media.AudioDevice audioDevice,
                                                        @NonNull
                                                        HandsetType handset)

      Is the given audio device of the type matching the given handset type?
      Parameters:
        `audioDevice` - The `AudioDevice` in question.
        `handset` - The `HandsetType` in question.
      Returns:
        `true` if the audio device matches the handset type, `false` otherwise.