Class VoiceManager
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGets the current voice input mode of the user.intgetLocalVolume(long userId) Gets the local volume adjustment for the user with the given ID.booleanisLocalMute(long userId) Checks if a user with a given ID is locally muted by the current user.booleanGets whether the current user has deafened themselves.booleanGets whether the current user has muted themselves.voidsetInputMode(VoiceInputMode inputMode) Sets a new voice input mode for the current user.voidsetInputMode(VoiceInputMode inputMode, Consumer<Result> callback) Sets a new voice input mode for the current user.voidsetLocalMute(long userId, boolean mute) Locally mutes or unmutes the user with the given ID.voidsetLocalVolume(long userId, int volume) Adjust the volume for a given user id locally.voidsetSelfDeaf(boolean selfDeaf) Deafens or undeafens the current user (self deaf).voidsetSelfMute(boolean selfMute) Mutes or unmutes the current user (self mute).
-
Method Details
-
getInputMode
Gets the current voice input mode of the user.This method only returns a copy of the input mode. Modifying it will not affect the current voice input mode unless you use
setInputMode(VoiceInputMode, Consumer).- Returns:
- The current
VoiceInputMode - Throws:
GameSDKException- for aResultthat is notResult.OK- See Also:
-
setInputMode
Sets a new voice input mode for the current user.Discord checks the validity of the
VoiceInputMode.getShortcut()and e.g. removes illegal keys (no error is thrown). However, the plausibility is not checked, allowing shortcuts to contain the same key multiple times and to be composed of as many keys as you can fit into the string (max length is 255 bytes).- Parameters:
inputMode- The new voice input modecallback- Callback to process the returnedResult- See Also:
-
setInputMode
Sets a new voice input mode for the current user.The
Core.DEFAULT_CALLBACKis used to handle the returnedResult.- Parameters:
inputMode- The new voice input mode- See Also:
-
isSelfMute
public boolean isSelfMute()Gets whether the current user has muted themselves.- Returns:
trueif the current user is currently muted- Throws:
GameSDKException- for aResultthat is notResult.OK- See Also:
-
setSelfMute
public void setSelfMute(boolean selfMute) Mutes or unmutes the current user (self mute).- Parameters:
selfMute-trueto mute,falseto unmute- Throws:
GameSDKException- for aResultthat is notResult.OK- See Also:
-
isSelfDeaf
public boolean isSelfDeaf()Gets whether the current user has deafened themselves.- Returns:
trueif the current user is currently deafened- Throws:
GameSDKException- for aResultthat is notResult.OK- See Also:
-
setSelfDeaf
public void setSelfDeaf(boolean selfDeaf) Deafens or undeafens the current user (self deaf).- Parameters:
selfDeaf-trueto deafen,falseto undeafen- Throws:
GameSDKException- for aResultthat is notResult.OK- See Also:
-
isLocalMute
public boolean isLocalMute(long userId) Checks if a user with a given ID is locally muted by the current user.- Parameters:
userId- ID of the user to check- Returns:
trueif the user is locally muted- Throws:
GameSDKException- for aResultthat is notResult.OK- See Also:
-
setLocalMute
public void setLocalMute(long userId, boolean mute) Locally mutes or unmutes the user with the given ID.- Parameters:
userId- ID of the user to (un)mutemute-trueto mute the user,falseto unmute the user- Throws:
GameSDKException- for aResultthat is notResult.OK- See Also:
-
getLocalVolume
public int getLocalVolume(long userId) Gets the local volume adjustment for the user with the given ID.A volume of
100is default. A volume lower than that means that the volume for the given user is reduced (a volume of0means no sound at all). If the volume is higher than the default, it is boosted (up to200which is the maximal boost).- Parameters:
userId- ID of the user to get the volume adjustment for- Returns:
- The volume adjustment in percent, an integer in percent between 0 and 200
- Throws:
GameSDKException- for aResultthat is notResult.OK- See Also:
-
setLocalVolume
public void setLocalVolume(long userId, int volume) Adjust the volume for a given user id locally.A volume of
100is default. A volume lower than that means that the volume for the given user is reduced (a volume of0means no sound at all). If the volume is higher than the default, it is boosted (up to200which is the maximal boost).- Parameters:
userId- ID of the user to adjust the volume forvolume- New volume adjustment in percent, an integer from 0 to 200- Throws:
GameSDKException- for aResultthat is notResult.OK- See Also:
-