AudioCapture

interface AudioCapture

Manages audio capture thread.

On each thread iteration, iterates all ClientActivations ordered by getWeight and if ClientActivation is activated - encodes, encrypts and sends PlayerAudioPacket to the UDP server using UdpClient.

If ClientActivation supports stereo and stereo capture is enabled in config - stereo encoder will be used to encode audio data, otherwise - mono encoder.

By default, the default encoders from AudioCapture will be used. However if getMonoEncoder or getStereoEncoder is not null, then they will be used instead.

Functions

Link copied to clipboard
Gets the default mono encoder if ServerInfo's CaptureInfo is not null.
Link copied to clipboard
Gets the default stereo encoder if ServerInfo's CaptureInfo is not null.
Link copied to clipboard
abstract fun getDevice(): Optional<InputDevice>
Gets the current input device if it was initialized in initialize.
Link copied to clipboard
Gets the default encryption method if ServerInfo's Encryption is not null.
Link copied to clipboard
abstract fun initialize(@NotNull serverInfo: @NotNull ServerInfo)
Initializes AudioCapture and starts a new thread that captures audio data from the opened input device.
Link copied to clipboard
abstract fun isActive(): Boolean
Checks if the capture thread is active.
Link copied to clipboard
abstract fun isServerMuted(): Boolean
Checks if the client is muted on the server.
Link copied to clipboard
abstract fun start()
Starts a new thread that reads audio data from the InputDevice.
Link copied to clipboard
abstract fun stop()
Stops the thread if isActive is true; otherwise, it does nothing.