Interface ClientReceiveSoundEvent

All Superinterfaces:
ClientEvent, Event
All Known Subinterfaces:
ClientReceiveSoundEvent.EntitySound, ClientReceiveSoundEvent.LocationalSound, ClientReceiveSoundEvent.StaticSound

public interface ClientReceiveSoundEvent extends ClientEvent
This event is emitted before the sound is played on the client.
  • Method Details

    • getId

      UUID getId()
      Returns:
      the ID of the channel
    • getRawAudio

      short[] getRawAudio()
      The unencoded audio data.
      Returns an empty array in case of the end of transmission
      Returns:
      the raw 16 bit PCM audio frame
    • setRawAudio

      void setRawAudio(@Nullable short[] rawAudio)
      Overrides the actual audio data that is played.

      This is ignored, if the getRawAudio() array is empty
      Providing audio that's not 960 samples will be ignored. An empty array or null skips this frame, which adds latency. To mute the audio, use an array filled with zeros instead.

      Parameters:
      rawAudio - the raw 16 bit PCM audio frame