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 Type
    Method
    Description
    void
    Stops and clears all active sound channels.
    int
    Returns the count of currently active playing sound channels.
    Returns the set of UUIDs for all active playing sound channels.
    de.maxhenkel.voicechat.api.VoicechatServerApi
    Gets the underlying VoicechatServerApi instance.
    de.maxhenkel.voicechat.api.opus.OpusDecoder
    getDecoder(@NotNull UUID uuid)
    Retrieves or creates a cached OpusDecoder for a player.
    de.maxhenkel.voicechat.api.opus.OpusEncoder
    getEncoder(@NotNull UUID uuid)
    Retrieves or creates a cached OpusEncoder for a player.
    boolean
    Checks whether global debug logging is enabled.
    boolean
    isPlayerConnected(@NotNull UUID uuid)
    Checks whether a player is connected to the voice chat server.
    void
    playSound(@NotNull VoiceSoundBuilder builder)
    Plays a positional or global sound configured via VoiceSoundBuilder.
    void
    setDebug(boolean value)
    Sets global debug logging flag.
    boolean
    stopSound(@NotNull UUID soundId)
    Stops an active sound channel by its UUID.
  • Method Details

    • isDebug

      boolean isDebug()
      Checks whether global debug logging is enabled.
      Returns:
      true if 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

      void playSound(@NotNull @NotNull VoiceSoundBuilder builder)
      Plays a positional or global sound configured via VoiceSoundBuilder.
      Parameters:
      builder - the sound configuration builder
    • getActiveSoundCount

      int getActiveSoundCount()
      Returns the count of currently active playing sound channels.
      Returns:
      active sound count
    • getActiveSoundIds

      Set<UUID> getActiveSoundIds()
      Returns the set of UUIDs for all active playing sound channels.
      Returns:
      set of sound UUIDs
    • stopSound

      boolean stopSound(@NotNull @NotNull UUID soundId)
      Stops an active sound channel by its UUID.
      Parameters:
      soundId - the sound channel UUID
      Returns:
      true if sound was found and stopped
    • clearAllSounds

      void clearAllSounds()
      Stops and clears all active sound channels.
    • isPlayerConnected

      boolean isPlayerConnected(@NotNull @NotNull UUID uuid)
      Checks whether a player is connected to the voice chat server.
      Parameters:
      uuid - the player UUID
      Returns:
      true if connected
    • getDecoder

      de.maxhenkel.voicechat.api.opus.OpusDecoder getDecoder(@NotNull @NotNull UUID uuid)
      Retrieves or creates a cached OpusDecoder for a player.
      Parameters:
      uuid - the player UUID
      Returns:
      the OpusDecoder
    • getEncoder

      de.maxhenkel.voicechat.api.opus.OpusEncoder getEncoder(@NotNull @NotNull UUID uuid)
      Retrieves or creates a cached OpusEncoder for a player.
      Parameters:
      uuid - the player UUID
      Returns:
      the OpusEncoder