nn.pp.audiocore

## Class AudioDevice

- java.lang.Object
- - nn.pp.audiocore.AudioDevice

-     public abstract class AudioDevice
      extends java.lang.Object

  An audio device used with `AudioCore`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AudioDevice.ConnectedDevice` A connected Audio Device forms an association between an audio device (`AudioDevice`) and an audio connection (`AudioCore`).

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AudioDevice(javax.sound.sampled.Mixer mixer, java.util.List<AudioFormat> formats)` Create an audio device

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `audioDevicesAvailable()` Get the information whether there are any audio devices (playback or capture) available at the client
    `static java.util.List<AudioDevice>` | `enumerateCaptureDevices()` Get the available capture (microphone) devices available at the client
    `static java.util.List<AudioDevice>` | `enumeratePlaybackDevices()` Get the available playback (headphones or speaker) devices available at the client
    `boolean` | `equals(java.lang.Object o)`
    `static AudioDevice` | `findCaptureDevice(java.lang.String name)` Find a capture device with a given name
    `static AudioDevice` | `findPlaybackDevice(java.lang.String name)` Find a playback device with a given name
    `static java.util.List<AudioDevice.ConnectedDevice>` | `getConnectedDevices()` Find all audio devices which are currently connected to any target
    `java.lang.String` | `getDescription()` Get a more detailed description of this audio device
    `javax.sound.sampled.Mixer` | `getMixer()` Get the underlying mixer device
    `javax.sound.sampled.Mixer.Info` | `getMixerInfo()` Get the information about the underlying audio device
    `java.lang.String` | `getName()` Get the user friendly name for this audio device
    `java.util.List<AudioFormat>` | `getSupportedFormats()` Get the list of supported audio formats of this audio device
    `int` | `hashCode()`
    `java.lang.String` | `toString()` Get the string representation of this audio device

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### AudioDevice

          public AudioDevice(javax.sound.sampled.Mixer mixer,
                             java.util.List<AudioFormat> formats)

      Create an audio device
      Parameters:
        `mixer` - the audio mixer (underlying audio device) used for this device
        `formats` - the list of supported audio formats

  - ### Method Detail

    - #### getName

          public java.lang.String getName()

      Get the user friendly name for this audio device
      Returns:
        the user friendly name for this audio device, or null in case of the default device

    - #### getDescription

          public java.lang.String getDescription()

      Get a more detailed description of this audio device
      Returns:
        a more detailed description of this audio device, or null in case of the default device

    - #### toString

          public java.lang.String toString()

      Get the string representation of this audio device
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        the string representation of this audio device

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### getSupportedFormats

          public java.util.List<AudioFormat> getSupportedFormats()

      Get the list of supported audio formats of this audio device
      Returns:
        the list of supported audio formats of this audio device

    - #### getMixer

          public javax.sound.sampled.Mixer getMixer()

      Get the underlying mixer device
      Returns:
        the underlying mixer device, or null in case of the default device

    - #### getMixerInfo

          public javax.sound.sampled.Mixer.Info getMixerInfo()

      Get the information about the underlying audio device
      Returns:
        the information about the underlying audio device, or null in case of the default device

    - #### enumeratePlaybackDevices

          public static java.util.List<AudioDevice> enumeratePlaybackDevices()

      Get the available playback (headphones or speaker) devices available at the client
      Returns:
        the available playback (headphones or speaker) devices available at the client

    - #### enumerateCaptureDevices

          public static java.util.List<AudioDevice> enumerateCaptureDevices()

      Get the available capture (microphone) devices available at the client
      Returns:
        the available capture (microphone) devices available at the client

    - #### audioDevicesAvailable

          public static boolean audioDevicesAvailable()

      Get the information whether there are any audio devices (playback or capture) available at the client
      Returns:
        `true` if there are any audio devices available at the client, `false` otherwise

    - #### findPlaybackDevice

          public static AudioDevice findPlaybackDevice(java.lang.String name)

      Find a playback device with a given name
      Parameters:
        `name` - the name of the playback device
      Returns:
        the playback device with the given name, or null if not found

    - #### findCaptureDevice

          public static AudioDevice findCaptureDevice(java.lang.String name)

      Find a capture device with a given name
      Parameters:
        `name` - the name of the capture device
      Returns:
        the capture device with the given name, or null if not found

    - #### getConnectedDevices

          public static java.util.List<AudioDevice.ConnectedDevice> getConnectedDevices()

      Find all audio devices which are currently connected to any target
      Returns:
        all audio devices which are currently connected to any target

Copyright © 2025 Raritan Inc. All Rights Reserved.