Class VoicePeerOptions
java.lang.Object
com.craftmend.openaudiomc.api.voice.VoicePeerOptions
- All Implemented Interfaces:
Cloneable
Voice chat options are special flags set for each peer, giving the client extra information on how the connection
should be treated and rendered. The initial state is defined by the default values in this class, and get passed during
the connection request packet sent towards the client. These settings can also be changed on the fly, by pushing them
in a separate client options update packet without needing the session to reload.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionVoicePeerOptions
(boolean visible, boolean spatialAudio, @Nullable DisplayOverride displayOverride) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
clone()
Clone the objectboolean
@Nullable DisplayOverride
An optional display override, which can be used to change the display name and skin of a player in the voice chat system.int
hashCode()
boolean
This flag decides if the stream should be rendered as a spatial stream.boolean
Weather or not the peer should be visible in the web UI.void
setDisplayOverride
(@Nullable DisplayOverride displayOverride) An optional display override, which can be used to change the display name and skin of a player in the voice chat system.void
setSpatialAudio
(boolean spatialAudio) This flag decides if the stream should be rendered as a spatial stream.void
setVisible
(boolean visible) Weather or not the peer should be visible in the web UI.toString()
-
Field Details
-
DEFAULT
Singleton default. Means we don't have to create a new object every time we want to use the default.
-
-
Constructor Details
-
VoicePeerOptions
public VoicePeerOptions() -
VoicePeerOptions
public VoicePeerOptions(boolean visible, boolean spatialAudio, @Nullable @Nullable DisplayOverride displayOverride)
-
-
Method Details
-
clone
Clone the object -
isVisible
public boolean isVisible()Weather or not the peer should be visible in the web UI. The client will still setup a voice stream to the peer if set to false, but completely hide the person's name/uuid from the web UI. This can be used for example to hide an opponent in a game, while still letting them hear each other. -
isSpatialAudio
public boolean isSpatialAudio()This flag decides if the stream should be rendered as a spatial stream. This also requires the client to receive location updates every few ticks. Setting it to false just renders it as a normal mono stream (think discord/teamspeak). The icon next to someone's name also gets controlled by this flag. -
getDisplayOverride
An optional display override, which can be used to change the display name and skin of a player in the voice chat system. This can be left null if no override is needed.- Since:
- 6.10.2
-
setVisible
public void setVisible(boolean visible) Weather or not the peer should be visible in the web UI. The client will still setup a voice stream to the peer if set to false, but completely hide the person's name/uuid from the web UI. This can be used for example to hide an opponent in a game, while still letting them hear each other. -
setSpatialAudio
public void setSpatialAudio(boolean spatialAudio) This flag decides if the stream should be rendered as a spatial stream. This also requires the client to receive location updates every few ticks. Setting it to false just renders it as a normal mono stream (think discord/teamspeak). The icon next to someone's name also gets controlled by this flag. -
setDisplayOverride
An optional display override, which can be used to change the display name and skin of a player in the voice chat system. This can be left null if no override is needed.- Since:
- 6.10.2
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-