ServerAudioSource

Base interface for server audio sources.

Source states Some methods mark the source as "dirty" and increment its state. If a source is marked as "dirty", it will broadcast its updated information to the players before sending the next UDP packet. If players go out of range and then return to the source's range, and if the state in the UDP packet differs from their source state, the players will request source information themselves. If the source state is increased by more than 10 (e.g. in setStereo), there may be delays in receiving certain UDP packets. This could result in packet drops and potential audio distortion.

Inheritors

Functions

Link copied to clipboard
abstract fun <P : VoicePlayer?> addFilter(@NotNull filter: @NotNull Predicate<out Any>)
Adds a new player filter to the source.
Link copied to clipboard
abstract fun clearFilters()
Clears all filters from the source.
Link copied to clipboard
@NotNull
abstract fun getAddon(): @NotNull AddonContainer
Gets the addon associated with this audio source.
Link copied to clipboard
@NotNull
abstract fun getFilters(): @NotNull Collection<Predicate<out Any>>
Gets the collection of player filters associated with this source.
Link copied to clipboard
@NotNull
abstract fun getId(): @NotNull UUID
Gets the unique identifier of this audio source.
Link copied to clipboard
@NotNull
abstract fun getLine(): @NotNull BaseServerSourceLine
Gets the server source line to which this audio source belongs.
Link copied to clipboard
abstract fun getSourceInfo(): S
Link copied to clipboard
abstract fun getState(): Int
Gets the state of this audio source.
Link copied to clipboard
abstract fun isIconVisible(): Boolean
Checks if the icon for this audio source is visible in the world.
Link copied to clipboard
abstract fun <P : VoicePlayer?> matchFilters(@NotNull player: @NotNull P): Boolean
Checks if a player matches all filters associated with this source.
Link copied to clipboard
open fun <P : VoicePlayer?> notMatchFilters(@NotNull player: @NotNull P): Boolean
Checks if a player does not match any of the filters associated with this source.
Link copied to clipboard
open fun remove()
Removes the source from its associated source line.
Link copied to clipboard
abstract fun <P : VoicePlayer?> removeFilter(@NotNull filter: @NotNull Predicate<out Any>)
Removes a player filter from the source.
Link copied to clipboard
abstract fun setDirty()
Marks the source as "dirty".
Link copied to clipboard
abstract fun setIconVisible(visible: Boolean)
Sets whether the icon for this audio source is visible in the world.
Link copied to clipboard
abstract fun setName(@Nullable name: @Nullable String)
Sets the source name that will be visible in the overlay.
Link copied to clipboard
abstract fun setStereo(stereo: Boolean)
Sets the source mode to stereo.