DeviceManager

interface DeviceManager

Manages audio devices.

Functions

Link copied to clipboard
open fun clear()
Closes and removes the output and input devices.
Link copied to clipboard
@NotNull
abstract fun getInputDevice(): @NotNull Optional<InputDevice>
Gets the current input device.
Link copied to clipboard
@NotNull
abstract fun getInputDeviceError(): @NotNull Optional<Throwable>
Gets the last input device error.
Link copied to clipboard
@NotNull
abstract fun getOutputDevice(): @NotNull Optional<AlContextOutputDevice>
Gets the current output device.
Link copied to clipboard
@NotNull
abstract fun openInputDevice(@Nullable format: @Nullable AudioFormat): @NotNull InputDevice
Opens a new input device with the specified audio format and device parameters.
Link copied to clipboard
@NotNull
abstract fun openOutputDevice(@Nullable format: @Nullable AudioFormat): @NotNull AlContextOutputDevice
Opens a new output device with the specified audio format and device parameters.
Link copied to clipboard
@NotNull
abstract fun reloadInputDevice(): @NotNull CompletableFuture<@Nullable InputDevice>
Closes the current input device and opens a new one in the background, using the configured device name, input backend and the current ServerInfo voice format.
Link copied to clipboard
@NotNull
abstract fun reloadOutputDevice(): @NotNull CompletableFuture<@Nullable AlContextOutputDevice>
Closes the current output device and opens a new one in the background, using the configured device name and the current ServerInfo voice format.
Link copied to clipboard
open fun setInputDevice(@Nullable device: @Nullable InputDevice)
abstract fun setInputDevice(@Nullable device: @Nullable InputDevice, @Nullable lastError: @Nullable Throwable)
Sets an input device.
Link copied to clipboard
abstract fun setOutputDevice(@Nullable device: @Nullable AlContextOutputDevice)
Sets an output device.