Class AudioSystem2

    • Constructor Detail

    • Method Detail

      • addUpdateAvailableDeviceListListener

        public void addUpdateAvailableDeviceListListener​(UpdateAvailableDeviceListListener listener)
        Adds a listener which is to be notified before and after this AudioSystem's method updateAvailableDeviceList() is invoked.

        Note: The AudioSystem2 class keeps a WeakReference to the specified listener in order to avoid memory leaks.

        Parameters:
        listener - the UpdateAvailableDeviceListListener to be notified before and after this AudioSystem's method updateAvailableDeviceList() is invoked
      • bubbleUpUsbDevices

        protected static void bubbleUpUsbDevices​(List<CaptureDeviceInfo2> devices)
        Sorts a specific list of CaptureDeviceInfo2s so that the ones representing USB devices appear at the beginning/top of the specified list.
        Parameters:
        devices - the list of CaptureDeviceInfo2s to be sorted so that the ones representing USB devices appear at the beginning/top of the list
      • didOpenStream

        public void didOpenStream()
        Notifies this AudioSystem that an API client finished executing a Pa_OpenStream-like function.
      • matchDevicesByName

        protected static void matchDevicesByName​(List<CaptureDeviceInfo2> captureDevices,
                                                 List<CaptureDeviceInfo2> playbackDevices)
        Attempts to reorder specific lists of capture and playback/notify CaptureDeviceInfo2s so that devices from the same hardware appear at the same indices in the respective lists. The judgment with respect to the belonging to the same hardware is based on the names of the specified CaptureDeviceInfo2s. The implementation is provided as a fallback to stand in for scenarios in which more accurate relevant information is not available.
        Parameters:
        captureDevices -
        playbackDevices -
      • reinitialize

        protected void reinitialize()
                             throws Exception
        Reinitializes this AudioSystem in order to bring it up to date with possible changes in the list of available devices. Invokes updateAvailableDeviceList() to update the devices on the native side and then DeviceSystem.initialize() to reflect any changes on the Java side. Invoked by the native side of this AudioSystem when it detects that the list of available devices has changed.
        Throws:
        Exception - if there was an error during the invocation of updateAvailableDeviceList() and DeviceSystem.initialize()
      • updateAvailableDeviceList

        protected abstract void updateAvailableDeviceList()
      • willOpenStream

        public void willOpenStream()
        Notifies this AudioSystem that an API client will start executing a Pa_OpenStream-like function.