Class AudioDeviceConfig
java.lang.Object
de.pottgames.tuningfork.AudioDeviceConfig
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringMust be one of the device specifiers you can query withAudioDevice.availableDevices().protected intDefines how many effects can be attached to sound sources.protected booleanWhether to use the OpenAL output limiter that prevents clipping on the output.protected OutputModeThe desired output mode.protected AudioDeviceRerouterA device rerouter is responsible for routing the audio to another audio device when the connection to the current device is lost. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleansetDeviceSpecifier(String deviceSpecifier) Must be one of the device specifiers you can query withAudioDevice.availableDevices().setEffectSlots(int effectSlots) Defines how many effects can be attached to sound sources.setEnableOutputLimiter(boolean enableOutputLimiter) Whether to use the OpenAL output limiter that prevents clipping on the output.setOutputMode(OutputMode mode) Request an output mode of your choice.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.
-
Field Details
-
deviceSpecifier
Must be one of the device specifiers you can query withAudioDevice.availableDevices(). Leave it null to use the default audio device. -
enableOutputLimiter
protected boolean enableOutputLimiterWhether to use the OpenAL output limiter that prevents clipping on the output. -
effectSlots
protected int effectSlotsDefines how many effects can be attached to sound sources. It's not guaranteed that the device will provide as many slots as requested. CallAudioDevice.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
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
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. SetOutputMode.ANYto let the system find the most fitting mode for you.
-
-
Constructor Details
-
AudioDeviceConfig
public AudioDeviceConfig()
-
-
Method Details
-
getDeviceSpecifier
-
setDeviceSpecifier
Must be one of the device specifiers you can query withAudioDevice.availableDevices(). Leave it null to use the default audio device.- Parameters:
deviceSpecifier- the device name- Returns:
- this
-
isEnableOutputLimiter
public boolean isEnableOutputLimiter() -
setEnableOutputLimiter
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
Defines how many effects can be attached to sound sources. It's not guaranteed that the device will provide as many slots as requested. CallAudioDevice.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
-
setRerouter
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
-
setOutputMode
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. SetOutputMode.ANYto 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 withAudioDevice.getOutputMode().- Parameters:
mode- the desired output mode- Returns:
- this
-