Interface VoiceService
public interface VoiceService
Core service managing Simple Voice Chat API integration, sound playback channels,
and per-player Opus codec instances.
-
Method Summary
Modifier and TypeMethodDescriptionvoidStops and clears all active sound channels.intReturns the count of currently active playing sound channels.Returns the set of UUIDs for all active playing sound channels.de.maxhenkel.voicechat.api.VoicechatServerApigetAPI()Gets the underlying VoicechatServerApi instance.de.maxhenkel.voicechat.api.opus.OpusDecodergetDecoder(@NotNull UUID uuid) Retrieves or creates a cached OpusDecoder for a player.de.maxhenkel.voicechat.api.opus.OpusEncodergetEncoder(@NotNull UUID uuid) Retrieves or creates a cached OpusEncoder for a player.booleanisDebug()Checks whether global debug logging is enabled.booleanisPlayerConnected(@NotNull UUID uuid) Checks whether a player is connected to the voice chat server.voidplaySound(@NotNull VoiceSoundBuilder builder) Plays a positional or global sound configured viaVoiceSoundBuilder.voidsetDebug(boolean value) Sets global debug logging flag.booleanStops an active sound channel by its UUID.
-
Method Details
-
isDebug
boolean isDebug()Checks whether global debug logging is enabled.- Returns:
trueif debug is active
-
setDebug
void setDebug(boolean value) Sets global debug logging flag.- Parameters:
value- debug flag
-
getAPI
de.maxhenkel.voicechat.api.VoicechatServerApi getAPI()Gets the underlying VoicechatServerApi instance.- Returns:
- the active API instance
-
playSound
Plays a positional or global sound configured viaVoiceSoundBuilder.- Parameters:
builder- the sound configuration builder
-
getActiveSoundCount
int getActiveSoundCount()Returns the count of currently active playing sound channels.- Returns:
- active sound count
-
getActiveSoundIds
-
stopSound
Stops an active sound channel by its UUID.- Parameters:
soundId- the sound channel UUID- Returns:
trueif sound was found and stopped
-
clearAllSounds
void clearAllSounds()Stops and clears all active sound channels. -
isPlayerConnected
Checks whether a player is connected to the voice chat server.- Parameters:
uuid- the player UUID- Returns:
trueif connected
-
getDecoder
Retrieves or creates a cached OpusDecoder for a player.- Parameters:
uuid- the player UUID- Returns:
- the
OpusDecoder
-
getEncoder
Retrieves or creates a cached OpusEncoder for a player.- Parameters:
uuid- the player UUID- Returns:
- the
OpusEncoder
-