Interface AudioSender
public interface AudioSender
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanSend()booleanbooleanreset()Resets the sequence number and indicates to clients that the current audio stream is paused/stopped.booleansend(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
- Parameters:
whispering- if the player should whisper- Returns:
- the audio sender itself
-
isWhispering
boolean isWhispering()- Returns:
- if the player is whispering
-
sequenceNumber
Sets the sequence number of the packet.
Setting this will override the automatic sequence numbering.
If you set this value, consequent calls tosend(byte[])will increase this number by 1. If you don't intend this, you need to set the sequence number every time before callingsend(byte[]).
Callingreset()will also reset the sequence number to start with0again.- 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
AudioSenderis 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:
trueif the packet was sent,falseif the sender does have the mod installed or theAudioSenderis 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.
-