Class RadioSpeaker

java.lang.Object
com.codinglitch.simpleradio.radio.RadioRouter
com.codinglitch.simpleradio.radio.RadioSpeaker
All Implemented Interfaces:
Socket, Router, Speaker

public class RadioSpeaker extends RadioRouter implements Speaker
A type of RadioRouter that accepts RadioMessages and emits them in-world.
Often serves as the end of the audio pipeline.
Does not route further.
  • Field Details

    • audioChannel

      public de.maxhenkel.voicechat.api.audiochannel.LocationalAudioChannel audioChannel
    • category

      public String category
    • range

      public float range
    • isSpeaking

      public boolean isSpeaking
    • gracePeriod

      public int gracePeriod
  • Constructor Details

    • RadioSpeaker

      protected RadioSpeaker(UUID id)
    • RadioSpeaker

      protected RadioSpeaker()
    • RadioSpeaker

      public RadioSpeaker(net.minecraft.world.entity.Entity owner)
    • RadioSpeaker

      public RadioSpeaker(net.minecraft.world.entity.Entity owner, UUID uuid)
    • RadioSpeaker

      public RadioSpeaker(WorldlyPosition location)
    • RadioSpeaker

      public RadioSpeaker(WorldlyPosition location, UUID uuid)
  • Method Details

    • getRange

      public float getRange()
      Specified by:
      getRange in interface Speaker
    • setRange

      public void setRange(float range)
      Specified by:
      setRange in interface Speaker
    • getCategory

      public String getCategory()
      Specified by:
      getCategory in interface Speaker
    • setCategory

      public void setCategory(String category)
      Specified by:
      setCategory in interface Speaker
    • open

      public void open()
      Starts streaming audio data through this speaker. Creates the audio channel and encoder.
    • close

      public void close()
    • generatePacket

      public short[] generatePacket()
    • dispatch

      public void dispatch()
      Description copied from interface: Router
      This method is called on the dispatcher thread, when every audio frame is meant to move at once. It is overridden by the speaker to stream audio data to clients.
      (Note that this is called after the router has received its message)
      Specified by:
      dispatch in interface Router
      Overrides:
      dispatch in class RadioRouter
    • accept

      public void accept(Message message)
      Description copied from interface: Router
      Accepts the message, notifying any integrations (such as CC:Tweaked) before taking the message.
      Specified by:
      accept in interface Router
      Overrides:
      accept in class RadioRouter
      Parameters:
      message - The message to be accepted
    • updateLocation

      public void updateLocation(WorldlyPosition location)
      Overrides:
      updateLocation in class RadioRouter
    • tick

      public void tick(int tickCount)
      Overrides:
      tick in class RadioRouter
    • take

      public void take(Message message)
      Description copied from interface: Router
      Takes the message, and pushes it if this router is capable of doing so.
      Specified by:
      take in interface Router
      Overrides:
      take in class RadioRouter
      Parameters:
      message - The message to be taken
    • speak

      public void speak(Message message)
    • invalidate

      public void invalidate()
      Specified by:
      invalidate in interface Router
      Overrides:
      invalidate in class RadioRouter