Interface AudioSender


public interface AudioSender
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    boolean
     
    boolean
    Resets the sequence number and indicates to clients that the current audio stream is paused/stopped.
    boolean
    send(byte[] opusEncodedAudioData)
    Acts as if the player has sent a microphone packet.
    sequenceNumber(long sequenceNumber)
    Sets the sequence number of the packet.
    whispering(boolean whispering)
     
  • Method Details

    • whispering

      AudioSender whispering(boolean whispering)
      Parameters:
      whispering - if the player should whisper
      Returns:
      the audio sender itself
    • isWhispering

      boolean isWhispering()
      Returns:
      if the player is whispering
    • sequenceNumber

      AudioSender sequenceNumber(long sequenceNumber)
      Sets the sequence number of the packet.
      Setting this will override the automatic sequence numbering.
      If you set this value, consequent calls to send(byte[]) will increase this number by 1. If you don't intend this, you need to set the sequence number every time before calling send(byte[]).
      Calling reset() will also reset the sequence number to start with 0 again.
      Parameters:
      sequenceNumber - the sequence number (Must be >= 0)
      Returns:
      the audio sender itself
    • canSend

      boolean canSend()
      Returns:
      if a microphone packet can be sent. This will return false if the player has the mod installed or the AudioSender is not registered.
    • send

      boolean send(byte[] opusEncodedAudioData)
      Acts as if the player has sent a microphone packet.
      Parameters:
      opusEncodedAudioData - the opus encoded audio data
      Returns:
      true if the packet was sent, false if the sender does have the mod installed or the AudioSender is not registered
    • reset

      boolean reset()
      Resets the sequence number and indicates to clients that the current audio stream is paused/stopped.
      This method should be called when the sending of audio is paused or stopped. You can still send audio after this method is called.