Interface AudioDeviceRerouter

All Superinterfaces:
com.badlogic.gdx.utils.Disposable
All Known Implementing Classes:
KeepAliveDeviceRerouter, SmartDeviceRerouter

public interface AudioDeviceRerouter extends com.badlogic.gdx.utils.Disposable
A device rerouter is responsible for routing the audio to another audio device when the connection to the current device is lost. May also be used to keep track of the default audio device of the OS and switch to it when a new default device is reported by the OS.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Gets called when a disconnect to the audio device is detected.
    void
    setup(long device, String desiredDeviceSpecifier, ContextAttributes attributes)
    This method is called before run.
    void
    Gets called right after setup and should start a background thread which is then responsible for rerouting.
    void
    This method gets called whenever the OpenAL context attributes change.
    void
    updateDesiredDevice(String desiredDeviceSpecifier)
    This method gets called when the user changes the device at runtime via AudioDevice.switchToDevice(String).

    Methods inherited from interface com.badlogic.gdx.utils.Disposable

    dispose
  • Method Details

    • setup

      void setup(long device, String desiredDeviceSpecifier, ContextAttributes attributes)
      This method is called before run.
      Parameters:
      device - the OpenAL device handle
      desiredDeviceSpecifier - the device specifier that was specified in AudioDeviceConfig.setDeviceSpecifier(String)
      attributes - the context attributes
    • updateDesiredDevice

      void updateDesiredDevice(String desiredDeviceSpecifier)
      This method gets called when the user changes the device at runtime via AudioDevice.switchToDevice(String).
      Parameters:
      desiredDeviceSpecifier - the device name
    • updateContextAttributes

      void updateContextAttributes(ContextAttributes attributes)
      This method gets called whenever the OpenAL context attributes change.
      Parameters:
      attributes - the context attributes
    • start

      void start()
      Gets called right after setup and should start a background thread which is then responsible for rerouting.
    • onDisconnect

      void onDisconnect()
      Gets called when a disconnect to the audio device is detected.