nn.pp.audiocore

## Class AudioAdapter

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

- All Implemented Interfaces:
    java.util.EventListener, AudioEventListener, NotificationListener

      public class AudioAdapter
      extends java.lang.Object
      implements NotificationListener, AudioEventListener

  This is a helper class which implements all the listener interfaces used by the `AudioEventListener` interface. If you want to implement these interfaces, you can derive from this class instead and just overwrite the methods you really need.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `AudioAdapter.Consumer<T>`

    - ### Nested classes/interfaces inherited from interface nn.pp.audiocore.AudioEventListener

      `AudioEventListener.DeviceState`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AudioAdapter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `audioConnected()` The session is successfully connected
    `AudioEventListener` | `audioConnected(java.lang.Runnable r)`
    `void` | `audioDisconnectedByUser()` The session has been disconnected by the user
    `AudioEventListener` | `audioDisconnectedByUser(java.lang.Runnable r)`
    `AudioEventListener` | `captureAudioFormatChanged(AudioAdapter.Consumer<AudioFormat> c)`
    `void` | `captureAudioFormatChanged(AudioFormat format)` The audio format of the capture device has changed.
    `AudioEventListener` | `captureDeviceStateChanged(AudioAdapter.Consumer<AudioEventListener.DeviceState> c)`
    `void` | `captureDeviceStateChanged(AudioEventListener.DeviceState state)` The device state of the capture device has changed.
    `AudioEventListener` | `captureMutedChanged(AudioAdapter.Consumer<java.lang.Boolean> c)`
    `void` | `captureMutedChanged(boolean muted)` The "muted" state in the client has changed.
    `AudioEventListener` | `disconnected(AudioAdapter.Consumer<java.lang.Exception> c)`
    `void` | `disconnected(java.lang.Exception e)` The session has been disconnected.
    `AudioEventListener` | `playbackAudioFormatChanged(AudioAdapter.Consumer<AudioFormat> c)`
    `void` | `playbackAudioFormatChanged(AudioFormat format)` The audio format of the playback device has changed.
    `AudioEventListener` | `playbackDeviceStateChanged(AudioAdapter.Consumer<AudioEventListener.DeviceState> c)`
    `void` | `playbackDeviceStateChanged(AudioEventListener.DeviceState state)` The device state of the playback device has changed.
    `AudioEventListener` | `playbackMutedChanged(AudioAdapter.Consumer<java.lang.Boolean> c)`
    `void` | `playbackMutedChanged(boolean muted)` The "muted" state in the client has changed.
    `NotificationListener` | `receivedNotification(AudioAdapter.Consumer<INotificationEvent> c)`
    `void` | `receivedNotification(INotificationEvent e)` A `NotificationEvent` has been received and shall be delivered.
    `NotificationListener` | `textNotification(AudioAdapter.Consumer<java.lang.String> c)`
    `void` | `textNotification(java.lang.String s)` An interesting event in text form should be delivered

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

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

- - ### Constructor Detail

    - #### AudioAdapter

          public AudioAdapter()

  - ### Method Detail

    - #### textNotification

          public void textNotification(java.lang.String s)

      Description copied from interface: `NotificationListener`
      An interesting event in text form should be delivered
      Specified by:
        `textNotification` in interface `NotificationListener`
      Parameters:
        `s` - The text event to deliver

    - #### receivedNotification

          public void receivedNotification(INotificationEvent e)

      Description copied from interface: `NotificationListener`
      A `NotificationEvent` has been received and shall be delivered.
      Specified by:
        `receivedNotification` in interface `NotificationListener`
      Parameters:
        `e` - The received event to deliver

    - #### audioConnected

          public void audioConnected()

      Description copied from interface: `AudioEventListener`
      The session is successfully connected
      Specified by:
        `audioConnected` in interface `AudioEventListener`

    - #### audioDisconnectedByUser

          public void audioDisconnectedByUser()

      Description copied from interface: `AudioEventListener`
      The session has been disconnected by the user
      Specified by:
        `audioDisconnectedByUser` in interface `AudioEventListener`

    - #### disconnected

          public void disconnected(java.lang.Exception e)

      Description copied from interface: `AudioEventListener`
      The session has been disconnected.
      Specified by:
        `disconnected` in interface `AudioEventListener`
      Parameters:
        `e` - An `Exception` that caused the session to terminate. This might be null if the session termination was not caused by an `Exception`.

    - #### playbackDeviceStateChanged

          public void playbackDeviceStateChanged(AudioEventListener.DeviceState state)

      Description copied from interface: `AudioEventListener`

      The device state of the playback device has changed.

      The KX reports the state of the audio device via this event handler. Audio devices may be muted and un-muted on the target.

      Note that the device always starts as muted.

      Specified by:
        `playbackDeviceStateChanged` in interface `AudioEventListener`
      Parameters:
        `state` - the state of the playback device
      See Also:
        `AudioCore.getPlaybackDeviceState()`

    - #### captureDeviceStateChanged

          public void captureDeviceStateChanged(AudioEventListener.DeviceState state)

      Description copied from interface: `AudioEventListener`

      The device state of the capture device has changed.

      The KX reports the state of the audio device via this event handler. Audio devices may be muted and un-muted on the target.

      Note that the device always starts as muted.

      Specified by:
        `captureDeviceStateChanged` in interface `AudioEventListener`
      Parameters:
        `state` - the state of the capture device
      See Also:
        `AudioCore.getCaptureDeviceState()`

    - #### playbackAudioFormatChanged

          public void playbackAudioFormatChanged(AudioFormat format)

      Description copied from interface: `AudioEventListener`

      The audio format of the playback device has changed.

      The actual audio format may be different than the requested format upon connection.

      Specified by:
        `playbackAudioFormatChanged` in interface `AudioEventListener`
      Parameters:
        `format` - The new audio format of the playback device
      See Also:
        `AudioCore.getPlaybackAudioFormat()`

    - #### captureAudioFormatChanged

          public void captureAudioFormatChanged(AudioFormat format)

      Description copied from interface: `AudioEventListener`

      The audio format of the capture device has changed.

      The actual audio format may be different than the requested format upon connection.

      Specified by:
        `captureAudioFormatChanged` in interface `AudioEventListener`
      Parameters:
        `format` - The new audio format of the capture device
      See Also:
        `AudioCore.getCaptureAudioFormat()`

    - #### playbackMutedChanged

          public void playbackMutedChanged(boolean muted)

      Description copied from interface: `AudioEventListener`

      The "muted" state in the client has changed.

      Note: This "muted" state is handled in the client only. It overrides the "muted" state sent by the KX device.

      Specified by:
        `playbackMutedChanged` in interface `AudioEventListener`
      Parameters:
        `muted` - The new muted state (client only)

    - #### captureMutedChanged

          public void captureMutedChanged(boolean muted)

      Description copied from interface: `AudioEventListener`

      The "muted" state in the client has changed.

      Note: This "muted" state is handled in the client only. It overrides the "muted" state sent by the KX device.

      Specified by:
        `captureMutedChanged` in interface `AudioEventListener`
      Parameters:
        `muted` - The new muted state (client only)

    - #### textNotification

          public NotificationListener textNotification(AudioAdapter.Consumer<java.lang.String> c)

    - #### receivedNotification

          public NotificationListener receivedNotification(AudioAdapter.Consumer<INotificationEvent> c)

    - #### audioConnected

          public AudioEventListener audioConnected(java.lang.Runnable r)

    - #### audioDisconnectedByUser

          public AudioEventListener audioDisconnectedByUser(java.lang.Runnable r)

    - #### disconnected

          public AudioEventListener disconnected(AudioAdapter.Consumer<java.lang.Exception> c)

    - #### playbackDeviceStateChanged

          public AudioEventListener playbackDeviceStateChanged(AudioAdapter.Consumer<AudioEventListener.DeviceState> c)

    - #### captureDeviceStateChanged

          public AudioEventListener captureDeviceStateChanged(AudioAdapter.Consumer<AudioEventListener.DeviceState> c)

    - #### playbackAudioFormatChanged

          public AudioEventListener playbackAudioFormatChanged(AudioAdapter.Consumer<AudioFormat> c)

    - #### captureAudioFormatChanged

          public AudioEventListener captureAudioFormatChanged(AudioAdapter.Consumer<AudioFormat> c)

    - #### playbackMutedChanged

          public AudioEventListener playbackMutedChanged(AudioAdapter.Consumer<java.lang.Boolean> c)

    - #### captureMutedChanged

          public AudioEventListener captureMutedChanged(AudioAdapter.Consumer<java.lang.Boolean> c)

Copyright © 2025 Raritan Inc. All Rights Reserved.