Interface AudioChannel

All Known Subinterfaces:
EntityAudioChannel, LocationalAudioChannel, StaticAudioChannel

public interface AudioChannel
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Call this if you are finished sending data.
     
     
    boolean
     
    void
    send(byte[] opusData)
    Sends the audio data to this audio channel.
    void
    Forwards the provided microphone packet to this audio channel.
    void
    setCategory(String category)
    Make sure you registered your category before using it.
    void
    Applies a filter to the audio channel.
  • Method Details

    • send

      void send(byte[] opusData)
      Sends the audio data to this audio channel.
      Parameters:
      opusData - Opus encoded audio data
    • send

      void send(MicrophonePacket packet)
      Forwards the provided microphone packet to this audio channel.
      Parameters:
      packet - the microphone packet containing the audio data
    • setFilter

      void setFilter(Predicate<ServerPlayer> filter)
      Applies a filter to the audio channel.
      Parameters:
      filter - only sends the data to players where the filter applies
    • flush

      void flush()
      Call this if you are finished sending data. You can still use this audio channel after calling this function, just don't call it after every packet, only after you are finished sending data.
    • isClosed

      boolean isClosed()
      Returns:
      if the audio channel is closed
    • getId

      UUID getId()
      Returns:
      the ID of the audio channel
    • getCategory

      @Nullable String getCategory()
      Returns:
      the category ID of the audio channel
    • setCategory

      void setCategory(@Nullable String category)
      Make sure you registered your category before using it. See VoicechatServerApi.registerVolumeCategory(VolumeCategory).
      Parameters:
      category - the category ID of the audio channel