Class AudioDeviceConfig

java.lang.Object
de.pottgames.tuningfork.AudioDeviceConfig

public class AudioDeviceConfig extends Object
  • Field Details

    • deviceSpecifier

      protected String deviceSpecifier
      Must be one of the device specifiers you can query with AudioDevice.availableDevices(). Leave it null to use the default audio device.
    • enableOutputLimiter

      protected boolean enableOutputLimiter
      Whether to use the OpenAL output limiter that prevents clipping on the output.
    • effectSlots

      protected int effectSlots
      Defines how many effects can be attached to sound sources. It's not guaranteed that the device will provide as many slots as requested. Call AudioDevice.getNumberOfEffectSlots() to check how many effects are actually available.
      Default is 2, 16 is the maximum on my system for example (to give you an idea about reasonable numbers).
    • rerouter

      protected AudioDeviceRerouter rerouter
      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. Default: SmartDeviceRerouter
    • outputMode

      protected OutputMode outputMode
      The desired output mode. It is just a hint for OpenAL and it might not give you the exact mode you wanted but its closest relative. Set OutputMode.ANY to let the system find the most fitting mode for you.
  • Constructor Details

    • AudioDeviceConfig

      public AudioDeviceConfig()
  • Method Details

    • getDeviceSpecifier

      public String getDeviceSpecifier()
    • setDeviceSpecifier

      public AudioDeviceConfig setDeviceSpecifier(String deviceSpecifier)
      Must be one of the device specifiers you can query with AudioDevice.availableDevices(). Leave it null to use the default audio device.
      Parameters:
      deviceSpecifier - the device name
      Returns:
      this
    • isEnableOutputLimiter

      public boolean isEnableOutputLimiter()
    • setEnableOutputLimiter

      public AudioDeviceConfig setEnableOutputLimiter(boolean enableOutputLimiter)
      Whether to use the OpenAL output limiter that prevents clipping on the output.
      Parameters:
      enableOutputLimiter - true to enable
      Returns:
      this
    • getEffectSlots

      public int getEffectSlots()
    • setEffectSlots

      public AudioDeviceConfig setEffectSlots(int effectSlots)
      Defines how many effects can be attached to sound sources. It's not guaranteed that the device will provide as many slots as requested. Call AudioDevice.getNumberOfEffectSlots() to check how many effects are actually available.
      Default is 2, 16 is the maximum on my system for example (to give you an idea about reasonable numbers).
      Parameters:
      effectSlots - the number of effect slots
      Returns:
      this
    • getRerouter

      public AudioDeviceRerouter getRerouter()
    • setRerouter

      public AudioDeviceConfig setRerouter(AudioDeviceRerouter rerouter)
      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. Default: KeepAliveDeviceRerouter
      Parameters:
      rerouter - the audio device rerouter
      Returns:
      this
    • getOutputMode

      public OutputMode getOutputMode()
    • setOutputMode

      public AudioDeviceConfig setOutputMode(OutputMode mode)
      Request an output mode of your choice. It is just a hint for OpenAL and it might not give you the exact mode you wanted but its closest relative. Set OutputMode.ANY to let the system find the most fitting mode for you, this is the default and recommended unless you have a specific reason to use another output mode.

      You can check the current output mode after initialization with AudioDevice.getOutputMode().
      Parameters:
      mode - the desired output mode
      Returns:
      this