Class RadioSpeaker
java.lang.Object
com.codinglitch.simpleradio.radio.RadioRouter
com.codinglitch.simpleradio.radio.RadioSpeaker
A type of
Often serves as the end of the audio pipeline.
Does not route further.
RadioRouter that accepts RadioMessages and emits them in-world.
Often serves as the end of the audio pipeline.
Does not route further.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.codinglitch.simpleradio.radio.RadioRouter
RadioRouter.AudioBuffer -
Field Summary
FieldsModifier and TypeFieldDescriptionde.maxhenkel.voicechat.api.audiochannel.LocationalAudioChannelintbooleanfloatFields inherited from class com.codinglitch.simpleradio.radio.RadioRouter
acceptCriteria, active, activity, activityTime, compiledActivity, compiledSamples, connectionOffset, distributes, identifier, link, owner, pending, position, reference, rotation, routeCriteria, routerAcceptor, routers, valid, wires -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRadioSpeaker(WorldlyPosition location) RadioSpeaker(WorldlyPosition location, UUID uuid) protectedRadioSpeaker(UUID id) RadioSpeaker(net.minecraft.world.entity.Entity owner) RadioSpeaker(net.minecraft.world.entity.Entity owner, UUID uuid) -
Method Summary
Modifier and TypeMethodDescriptionvoidAccepts the message, notifying any integrations (such as CC:Tweaked) before taking the message.voidclose()voiddispatch()This method is called on the dispatcher thread, when every audio frame is meant to move at once.short[]floatgetRange()voidvoidopen()Starts streaming audio data through this speaker.voidsetCategory(String category) voidsetRange(float range) voidvoidTakes the message, and pushes it if this router is capable of doing so.voidtick(int tickCount) voidupdateLocation(WorldlyPosition location) Methods inherited from class com.codinglitch.simpleradio.radio.RadioRouter
addRouter, allowDistribution, compileActivity, distanceTo, distanceTo, extract, getActivity, getActivityTime, getConnectionOffset, getConnectionPosition, getDecoder, getFrequency, getIdentifier, getLink, getLocation, getOwner, getPending, getPosition, getRedstoneMappedActivity, getReference, getRotation, getRouter, getRouter, getRouterFromReceivers, getRouterFromTransmitters, getRouters, getWires, informActivity, insert, isActive, isClientSide, isValid, prepareSource, push, route, route, send, send, send, send, send, send, send, send, send, send, setAcceptingCriteria, setActive, setConnectionOffset, setLink, setOwner, setPosition, setRotation, setRoutingCriteria, shouldRouteTo, toString, tryAddRouter, tryAddRouter, updateRotation, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.codinglitch.simpleradio.routers.Router
addRouter, allowDistribution, distanceTo, getActivity, getActivityTime, getConnectionOffset, getConnectionPosition, getFrequency, getIdentifier, getLink, getLocation, getOwner, getPending, getPosition, getRedstoneMappedActivity, getReference, getRotation, getRouter, getRouters, getWires, insert, isActive, isClientSide, isValid, push, route, send, send, send, send, send, send, send, send, send, send, setAcceptingCriteria, setActive, setConnectionOffset, setLink, setOwner, setPosition, setRotation, setRoutingCriteria, tryAddRouter, validateMethods inherited from interface com.codinglitch.simpleradio.central.Socket
canConnect, canConnectTo, connect, disconnect, disconnect, distribute, hasWire, hasWire, shortCircuit
-
Field Details
-
audioChannel
public de.maxhenkel.voicechat.api.audiochannel.LocationalAudioChannel audioChannel -
category
-
range
public float range -
isSpeaking
public boolean isSpeaking -
gracePeriod
public int gracePeriod
-
-
Constructor Details
-
RadioSpeaker
-
RadioSpeaker
protected RadioSpeaker() -
RadioSpeaker
public RadioSpeaker(net.minecraft.world.entity.Entity owner) -
RadioSpeaker
-
RadioSpeaker
-
RadioSpeaker
-
-
Method Details
-
getRange
public float getRange() -
setRange
public void setRange(float range) -
getCategory
- Specified by:
getCategoryin interfaceSpeaker
-
setCategory
- Specified by:
setCategoryin interfaceSpeaker
-
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:RouterThis 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:
dispatchin interfaceRouter- Overrides:
dispatchin classRadioRouter
-
accept
Description copied from interface:RouterAccepts the message, notifying any integrations (such as CC:Tweaked) before taking the message.- Specified by:
acceptin interfaceRouter- Overrides:
acceptin classRadioRouter- Parameters:
message- The message to be accepted
-
updateLocation
- Overrides:
updateLocationin classRadioRouter
-
tick
public void tick(int tickCount) - Overrides:
tickin classRadioRouter
-
take
Description copied from interface:RouterTakes the message, and pushes it if this router is capable of doing so.- Specified by:
takein interfaceRouter- Overrides:
takein classRadioRouter- Parameters:
message- The message to be taken
-
speak
-
invalidate
public void invalidate()- Specified by:
invalidatein interfaceRouter- Overrides:
invalidatein classRadioRouter
-