nn.pp.audiocore

## Interface AudioCore

-     public interface AudioCore

  The main interface of AudioCore which defines all the methods.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `BLK_SIZE_MULTIPLY` Block sizes must always be a multiple of this value (in milliseconds)
    `static int` | `DEFAULT_MIC_BLK_SIZE` The default value for the block size for the microphone device in milliseconds
    `static int` | `DEFAULT_SPK_BLK_SIZE` The default value for the block size for the speaker device in milliseconds
    `static int` | `MAX_MIC_BLK_SIZE` The maximum value for the block size for the microphone device in milliseconds
    `static int` | `MAX_SPK_BLK_SIZE` The maximum value for the block size for the speaker device in milliseconds
    `static int` | `MS_INDEX_FOR_HDMI_AUDIO` The mass storage index to use when HDMI audio is used.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAudioEventListener(AudioEventListener listener)` Adds the specified Audio Event listener to receive Audio events.
    `void` | `addNotificationListener(NotificationListener listener)` Adds the specified Notification listener to receive notification events.
    `void` | `connectAudioWithEricKey(java.lang.String host, int port, boolean sslMode, java.lang.String portID, int rfbSessionId, int msIndex, AudioDevice playbackDevice, AudioFormat playbackFormat, AudioDevice captureDevice, AudioFormat captureFormat, java.lang.String ericKey)` Connect using an eRic webs session key.
    `void` | `connectAudioWithRdmSession(java.lang.String host, int port, boolean sslMode, java.lang.String portID, int rfbSessionId, int msIndex, AudioDevice playbackDevice, AudioFormat playbackFormat, AudioDevice captureDevice, AudioFormat captureFormat, java.lang.String rdmSession, java.lang.String proxyConnectionIdAudio, java.lang.String proxyUseSSL)` Connect using a RDM Session ID and key.
    `void` | `connectAudioWithUserLogin(java.lang.String host, int port, boolean sslMode, java.lang.String portID, int rfbSessionId, int msIndex, AudioDevice playbackDevice, AudioFormat playbackFormat, AudioDevice captureDevice, AudioFormat captureFormat, java.lang.String username, java.lang.String password)` Connect using a user name and a password.
    `void` | `disconnect()` Disconnect from the `AudioCore`
    `void` | `disconnect(boolean abnormalTermination)` Disconnect from the `AudioCore`
    `void` | `dispose()` If you don't need the core any longer, call this `dispose()` method.
    `AudioFormat` | `getCaptureAudioFormat()` Get the actual audio format of the capture device.
    `int` | `getCaptureBufferSizeMs()` Get the capture buffer size in milliseconds.
    `AudioEventListener.DeviceState` | `getCaptureDeviceState()` Get the state of the capture device
    `AudioFormat` | `getPlaybackAudioFormat()` Get the actual audio format of the playback device.
    `int` | `getPlaybackBufferSizeMs()` Get the playback buffer size in milliseconds.
    `AudioEventListener.DeviceState` | `getPlaybackDeviceState()` Get the state of the playback device
    `boolean` | `isCaptureMuted()` Get the "muted" state of the capture device.
    `boolean` | `isPlaybackMuted()` Get the "muted" state of the playback device.
    `void` | `removeAudioEventListener(AudioEventListener listener)` Removes the specified Audio Event listener
    `void` | `removeNotificationListener(NotificationListener listener)` Removes the specified Notification listener
    `void` | `setCaptureBufferSizeMs(int bufferSizeMs)` Set the capture buffer size in milliseconds.
    `void` | `setCaptureMuted(boolean muted)` Set the "muted" state of the capture device.
    `void` | `setPlaybackBufferSizeMs(int bufferSizeMs)` Set the playback buffer size in milliseconds.
    `void` | `setPlaybackMuted(boolean muted)` Set the "muted" state of the playback device.
    `void` | `setSslSocketFactory(javax.net.ssl.SSLSocketFactory factory, boolean verifyHostname)` Set the SSL socket factory that is used by the connection and whether a host name verification should be performed additionally to certificate checks.

- - ### Field Detail

    - #### MS_INDEX_FOR_HDMI_AUDIO

          static final int MS_INDEX_FOR_HDMI_AUDIO

      The mass storage index to use when HDMI audio is used. HDMI audio does not use VM mass storage, so there is no mass storage index. Hence, a special index has to be used.
      See Also:
        Constant Field Values

    - #### DEFAULT_MIC_BLK_SIZE

          static final int DEFAULT_MIC_BLK_SIZE

      The default value for the block size for the microphone device in milliseconds
      See Also:
        `setCaptureBufferSizeMs(int)`, `getCaptureBufferSizeMs()`, Constant Field Values

    - #### DEFAULT_SPK_BLK_SIZE

          static final int DEFAULT_SPK_BLK_SIZE

      The default value for the block size for the speaker device in milliseconds
      See Also:
        `setPlaybackBufferSizeMs(int)`, `getPlaybackBufferSizeMs()`, Constant Field Values

    - #### MAX_MIC_BLK_SIZE

          static final int MAX_MIC_BLK_SIZE

      The maximum value for the block size for the microphone device in milliseconds
      See Also:
        `setCaptureBufferSizeMs(int)`, `getCaptureBufferSizeMs()`, Constant Field Values

    - #### MAX_SPK_BLK_SIZE

          static final int MAX_SPK_BLK_SIZE

      The maximum value for the block size for the speaker device in milliseconds
      See Also:
        `setPlaybackBufferSizeMs(int)`, `getPlaybackBufferSizeMs()`, Constant Field Values

    - #### BLK_SIZE_MULTIPLY

          static final int BLK_SIZE_MULTIPLY

      Block sizes must always be a multiple of this value (in milliseconds)
      See Also:
        `setCaptureBufferSizeMs(int)`, `getCaptureBufferSizeMs()`, `setPlaybackBufferSizeMs(int)`, `getPlaybackBufferSizeMs()`, Constant Field Values

  - ### Method Detail

    - #### dispose

          void dispose()

      If you don't need the core any longer, call this `dispose()` method.

    - #### setSslSocketFactory

          void setSslSocketFactory(javax.net.ssl.SSLSocketFactory factory,
                                   boolean verifyHostname)

      Set the SSL socket factory that is used by the connection and whether a host name verification should be performed additionally to certificate checks.

      By default, an SSL socket factory which does not perform any checks is used and host name verification is off. This is a potential security risk. If you want to change that, use a different SSL socket factory.

      AudioCore SSL implementation can be configured to use different SSL socket factories in order to implement certificate checking and other things. By default, an SSL socket factory is used which does not perform any security checks at all.

      Parameters:
        `factory` - The SSL socket factory to use
        `verifyHostname` - Whether host name verification should be performed

    - #### connectAudioWithUserLogin

          void connectAudioWithUserLogin(java.lang.String host,
                                         int port,
                                         boolean sslMode,
                                         java.lang.String portID,
                                         int rfbSessionId,
                                         int msIndex,
                                         AudioDevice playbackDevice,
                                         AudioFormat playbackFormat,
                                         AudioDevice captureDevice,
                                         AudioFormat captureFormat,
                                         java.lang.String username,
                                         java.lang.String password)
                                  throws java.io.IOException,
                                         AudioException

      Connect using a user name and a password.
      Parameters:
        `host` - host to connect to
        `port` - port number on which the connection is to be made to the host
        `sslMode` - use SSL encryption or not
        `portID` - unique port ID to connect to
        `rfbSessionId` - RFB session ID to connect this Audio session to
        `msIndex` - Mass storage index on which the audio device has to be mounted
        `playbackDevice` - the playback (speaker) device to be used; if this is null, the default device is used
        `playbackFormat` - the audio format for playback; if null, playback is disabled
        `captureDevice` - the capture (microphone) device to be used; if this is null, the default device is used
        `captureFormat` - the audio format for capture; if null, capture is disabled
        `username` - user name to authenticate
        `password` - password for the associated user name
      Throws:
        `java.io.IOException` - on I/O errors
        `AudioException` - if an audio related error occurs
      See Also:
        `connectAudioWithEricKey(String, int, boolean, String, int, int, AudioDevice, AudioFormat, AudioDevice, AudioFormat, String)`, `connectAudioWithRdmSession(String, int, boolean, String, int, int, AudioDevice, AudioFormat, AudioDevice, AudioFormat, String, String, String)`, `disconnect()`, `AudioEventListener.audioConnected()`

    - #### connectAudioWithRdmSession

          void connectAudioWithRdmSession(java.lang.String host,
                                          int port,
                                          boolean sslMode,
                                          java.lang.String portID,
                                          int rfbSessionId,
                                          int msIndex,
                                          AudioDevice playbackDevice,
                                          AudioFormat playbackFormat,
                                          AudioDevice captureDevice,
                                          AudioFormat captureFormat,
                                          java.lang.String rdmSession,
                                          java.lang.String proxyConnectionIdAudio,
                                          java.lang.String proxyUseSSL)
                                   throws java.io.IOException,
                                          AudioException

      Connect using a RDM Session ID and key. Pass RDM SessionID and SessionKey as follows: rdmSession = "\"" + rdmSessionId + "\":\"" + rdmSessionKey + "\""

      Parameters:
        `host` - host to connect to
        `port` - port number on which the connection is to be made to the host
        `sslMode` - value for ssl mode
        `portID` - unique port ID to connect to
        `rfbSessionId` - RFB session ID to connect this Audio session to
        `msIndex` - Mass storage index on which the audio device has to be mounted
        `playbackDevice` - the playback (speaker) device to be used; if this is null, the default device is used
        `playbackFormat` - the audio format for playback; if null, playback is disabled
        `captureDevice` - the capture (microphone) device to be used; if this is null, the default device is used
        `captureFormat` - the audio format for capture; if null, capture is disabled
        `rdmSession` - rdmSessionID and rdmSessionKey concatenated in the above format
        `proxyConnectionIdAudio` - ff going through CC-SG proxy , this will contain Audio connection id
        `proxyUseSSL` - if going through CC-SG proxy , SSL yes or not for proxy communication
      Throws:
        `java.io.IOException` - on I/O errors
        `AudioException` - if an audio related error occurs
      See Also:
        `connectAudioWithUserLogin(String, int, boolean, String, int, int, AudioDevice, AudioFormat, AudioDevice, AudioFormat, String, String)`, `connectAudioWithEricKey(String, int, boolean, String, int, int, AudioDevice, AudioFormat, AudioDevice, AudioFormat, String)`, `disconnect()`, `AudioEventListener.audioConnected()`

    - #### connectAudioWithEricKey

          void connectAudioWithEricKey(java.lang.String host,
                                       int port,
                                       boolean sslMode,
                                       java.lang.String portID,
                                       int rfbSessionId,
                                       int msIndex,
                                       AudioDevice playbackDevice,
                                       AudioFormat playbackFormat,
                                       AudioDevice captureDevice,
                                       AudioFormat captureFormat,
                                       java.lang.String ericKey)
                                throws java.io.IOException,
                                       AudioException

      Connect using an eRic webs session key.
      Parameters:
        `host` - host to connect to
        `port` - port number on which the connection is to be made to the host
        `sslMode` - value for ssl mode
        `portID` - unique port ID to connect to
        `rfbSessionId` - RFB session ID to connect this Audio session to
        `msIndex` - Mass storage index on which the audio device has to be mounted
        `playbackDevice` - the playback (speaker) device to be used; if this is null, the default device is used
        `playbackFormat` - the audio format for playback; if null, playback is disabled
        `captureDevice` - the capture (microphone) device to be used; if this is null, the default device is used
        `captureFormat` - the audio format for capture; if null, capture is disabled
        `ericKey` - eRic webs session key
      Throws:
        `java.io.IOException` - on I/O errors
        `AudioException` - if an audio related error occurs
      See Also:
        `connectAudioWithRdmSession(String, int, boolean, String, int, int, AudioDevice, AudioFormat, AudioDevice, AudioFormat, String, String, String)`, `connectAudioWithUserLogin(String, int, boolean, String, int, int, AudioDevice, AudioFormat, AudioDevice, AudioFormat, String, String)`, `disconnect()`, `AudioEventListener.audioConnected()`

    - #### disconnect

          void disconnect()

      Disconnect from the `AudioCore`

    - #### disconnect

          void disconnect(boolean abnormalTermination)

      Disconnect from the `AudioCore`
      Parameters:
        `abnormalTermination` - if `false`, then the `VirtualMediaEventListener.driveDisconnectedByUser()` event is generated, if `true` it is not

    - #### setCaptureBufferSizeMs

          void setCaptureBufferSizeMs(int bufferSizeMs)
                               throws java.io.IOException

      Set the capture buffer size in milliseconds. This currently works on a connected audio core only!
      Parameters:
        `bufferSizeMs` - The buffer size in milliseconds
      Throws:
        `java.io.IOException` - on I/O errors
      See Also:
        `getCaptureBufferSizeMs()`, `setPlaybackBufferSizeMs(int)`

    - #### getCaptureBufferSizeMs

          int getCaptureBufferSizeMs()

      Get the capture buffer size in milliseconds. This currently works on a connected audio core only!
      Returns:
        The buffer size in milliseconds
      See Also:
        `setCaptureBufferSizeMs(int)`, `getPlaybackBufferSizeMs()`

    - #### setPlaybackBufferSizeMs

          void setPlaybackBufferSizeMs(int bufferSizeMs)
                                throws java.io.IOException

      Set the playback buffer size in milliseconds. This currently works on a connected audio core only!
      Parameters:
        `bufferSizeMs` - The buffer size in milliseconds
      Throws:
        `java.io.IOException` - on I/O errors
      See Also:
        `getPlaybackBufferSizeMs()`, `setCaptureBufferSizeMs(int)`

    - #### getPlaybackBufferSizeMs

          int getPlaybackBufferSizeMs()

      Get the playback buffer size in milliseconds. This currently works on a connected audio core only!
      Returns:
        The buffer size in milliseconds
      See Also:
        `setPlaybackBufferSizeMs(int)`, `getCaptureBufferSizeMs()`

    - #### setPlaybackMuted

          void setPlaybackMuted(boolean muted)

      Set the "muted" state of the playback device. This currently works on a connected audio core only!
      Parameters:
        `muted` - the muted state
      See Also:
        `isPlaybackMuted()`

    - #### isPlaybackMuted

          boolean isPlaybackMuted()

      Get the "muted" state of the playback device. This currently works on a connected audio core only!
      Returns:
        the muted state
      See Also:
        `setPlaybackMuted(boolean)`

    - #### setCaptureMuted

          void setCaptureMuted(boolean muted)

      Set the "muted" state of the capture device. This currently works on a connected audio core only!
      Parameters:
        `muted` - the muted state
      See Also:
        `isCaptureMuted()`

    - #### isCaptureMuted

          boolean isCaptureMuted()

      Get the "muted" state of the capture device. This currently works on a connected audio core only!
      Returns:
        the muted state
      See Also:
        `setCaptureMuted(boolean)`

    - #### getPlaybackDeviceState

          AudioEventListener.DeviceState getPlaybackDeviceState()

      Get the state of the playback device
      Returns:
        The state of the playback device
      See Also:
        `AudioEventListener.playbackDeviceStateChanged(nn.pp.audiocore.AudioEventListener.DeviceState)`

    - #### getCaptureDeviceState

          AudioEventListener.DeviceState getCaptureDeviceState()

      Get the state of the capture device
      Returns:
        The state of the capture device
      See Also:
        `AudioEventListener.captureDeviceStateChanged(nn.pp.audiocore.AudioEventListener.DeviceState)`

    - #### getPlaybackAudioFormat

          AudioFormat getPlaybackAudioFormat()

      Get the actual audio format of the playback device.

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

      If the device is disconnected, null is returned.

      Returns:
        The actual audio format of the playback device
      See Also:
        `AudioEventListener.playbackAudioFormatChanged(AudioFormat)`

    - #### getCaptureAudioFormat

          AudioFormat getCaptureAudioFormat()

      Get the actual audio format of the capture device.

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

      If the device is disconnected, null is returned.

      Returns:
        The actual audio format of the capture device
      See Also:
        `AudioEventListener.captureAudioFormatChanged(AudioFormat)`

    - #### addNotificationListener

          void addNotificationListener(NotificationListener listener)

      Adds the specified Notification listener to receive notification events. Notification events occur when there is any Error/Warning/Info needs to be sent from the server to the connected and subscribed clients.
      Parameters:
        `listener` - the Notification Listener
      See Also:
        `removeNotificationListener(NotificationListener)`

    - #### removeNotificationListener

          void removeNotificationListener(NotificationListener listener)

      Removes the specified Notification listener
      Parameters:
        `listener` - the Notification Listener
      See Also:
        `addNotificationListener(NotificationListener)`

    - #### addAudioEventListener

          void addAudioEventListener(AudioEventListener listener)

      Adds the specified Audio Event listener to receive Audio events.
      Parameters:
        `listener` - the Audio Event Listener
      See Also:
        `removeAudioEventListener(AudioEventListener)`

    - #### removeAudioEventListener

          void removeAudioEventListener(AudioEventListener listener)

      Removes the specified Audio Event listener
      Parameters:
        `listener` - the Audio Event Listener
      See Also:
        `addAudioEventListener(AudioEventListener)`

Copyright © 2025 Raritan Inc. All Rights Reserved.