InputDevice

Represents an audio input device used for capturing audio data.

Functions

Link copied to clipboard
abstract fun addFilter(filter: AudioFilter, priority: AudioFilter.Priority)

Adds an audio filter to the device with the specified priority.

Link copied to clipboard
abstract fun available(): Int
Retrieves the number of available shorts audio samples that can be read from the input device.
Link copied to clipboard
abstract fun close()

Closes the audio device.

Link copied to clipboard

Gets the collection of audio filters applied to the device.

Link copied to clipboard
abstract fun getFormat(): AudioFormat

Gets the audio format associated with the device.

Link copied to clipboard
abstract fun getFrameSize(): Int

Gets the 20ms frame size calculated based on the audio format.

Link copied to clipboard
abstract fun getName(): String

Gets the name of the audio device.

Link copied to clipboard
@NotNull
open fun getType(): @NotNull DeviceType
Gets the type of the audio device.
Link copied to clipboard
abstract fun isOpen(): Boolean

Checks if the audio device is open.

Link copied to clipboard
abstract fun isStarted(): Boolean
Checks if the input device has been started.
Link copied to clipboard
abstract fun processFilters(samples: Array<Short>, excludeFilter: Predicate<AudioFilter>): Array<Short>

Processes a provided audio samples through all applicable filters.

Link copied to clipboard
open fun read(): Array<Short>
Reads short audio samples from the input device using the buffer size calculated from the AudioFormat.
abstract fun read(frameSize: Int): Array<Short>
Reads shorts audio samples from the input device with the specified buffer size.
Link copied to clipboard
abstract fun reload()

Reloads (closes and opens) the audio device.

Link copied to clipboard
abstract fun removeFilter(filter: AudioFilter)

Removes an audio filter from the device.

Link copied to clipboard
abstract fun start()
Starts the audio input device.
Link copied to clipboard
abstract fun stop()
Stops the audio input device.