Interface VoiceRadioService
public interface VoiceRadioService
Service managing radio channels, frequency tuning, Roger Beep feedback, and radio transmission routing.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddAudioTransmissionListener(@NotNull VoiceRadioService.RadioAudioTransmissionListener listener) Registers a listener called whenever radio voice audio is transmitted, providing the processed Opus audio.default voidaddTransmissionListener(BiConsumer<String, UUID> listener) Registers a listener called whenever a player transmits on a radio channel.getActiveRecording(@NotNull String channelName) Gets the active recording session for a radio channel, if any.de.maxhenkel.voicechat.api.VoicechatServerApigetAPI()Gets the underlying VoicechatServerApi instance.@Nullable RadioChannelgetChannel(@NotNull String name) Retrieves a radio channel by name.@Nullable RadioChannelgetChannelOfPlayer(@NotNull UUID playerUuid) Retrieves the active radio channel a player is currently tuned into.@NotNull Collection<RadioChannel> Returns all active radio frequency channels.@NotNull RadioChannelgetOrCreateChannel(@NotNull String name) Retrieves an existing radio channel by name, or creates a new one if it does not exist.default @Nullable VoiceRadioService.RadioPacketFilterRetrieves the current radio packet filter.voidinit(@NotNull de.maxhenkel.voicechat.api.VoicechatServerApi api) Initializes the radio service with the Simple Voice Chat server API.default booleanisChannelActive(@NotNull String channelName) Checks whether a radio channel is currently receiving active voice transmission.booleanisInChannel(@NotNull UUID playerUuid) Checks whether a player is connected to any radio channel.booleanisRadioPlaying(@NotNull String channelName) Checks whether a radio channel is currently playing back a recording.booleanisRecording(@NotNull String channelName) Checks whether a radio channel is currently being recorded.booleanjoinChannel(@NotNull UUID playerUuid, @NotNull String channelName) Tunes a player into a radio frequency channel.voidleaveChannel(@NotNull UUID playerUuid) Disconnects a player from their active radio frequency channel.voidload()Reloads saved radio channels from disk.voidplayRecordingToRadio(@NotNull String channelName, VoiceRecording recording) Broadcasts a voice recording across a radio channel to all tuned listeners and external systems.voidregister(@NotNull RadioChannel radioChannel) Registers a radio channel.default voidremoveChannel(@NotNull String name) Deletes a radio channel by name.voidsave()Saves all radio channels to disk.default voidsetPacketFilter(@Nullable VoiceRadioService.RadioPacketFilter filter) Sets a packet filter to control radio voice transmission between participants (e.g.startRecording(@NotNull String channelName) Starts a voice recording session capturing all transmissions on a radio channel.voidstopRadioPlayback(@NotNull String channelName) Stops any ongoing recording playback on a radio channel.stopRecording(@NotNull String channelName) Stops the active voice recording session on a radio channel.voidunregister(@NotNull String name) Unregisters a radio channel by name.voidUnregisters all radio channels.
-
Method Details
-
init
void init(@NotNull @NotNull de.maxhenkel.voicechat.api.VoicechatServerApi api) Initializes the radio service with the Simple Voice Chat server API.- Parameters:
api- the VoicechatServerApi instance
-
getChannels
Returns all active radio frequency channels.- Returns:
- collection of
RadioChannels
-
getOrCreateChannel
Retrieves an existing radio channel by name, or creates a new one if it does not exist.- Parameters:
name- the channel name- Returns:
- the
RadioChannel
-
getChannel
Retrieves a radio channel by name.- Parameters:
name- the channel name- Returns:
- the
RadioChannel, ornullif not found
-
getChannelOfPlayer
Retrieves the active radio channel a player is currently tuned into.- Parameters:
playerUuid- the player UUID- Returns:
- the
RadioChannel, ornullif not on any radio
-
getAPI
de.maxhenkel.voicechat.api.VoicechatServerApi getAPI()Gets the underlying VoicechatServerApi instance. -
register
Registers a radio channel. -
unregister
Unregisters a radio channel by name. -
isInChannel
Checks whether a player is connected to any radio channel. -
unregisterAll
void unregisterAll()Unregisters all radio channels. -
joinChannel
-
leaveChannel
Disconnects a player from their active radio frequency channel.- Parameters:
playerUuid- the player UUID
-
removeChannel
Deletes a radio channel by name.- Parameters:
name- the channel name
-
save
void save()Saves all radio channels to disk. -
load
void load()Reloads saved radio channels from disk. -
addTransmissionListener
Registers a listener called whenever a player transmits on a radio channel.- Parameters:
listener- (channelName, senderUuid)
-
setPacketFilter
Sets a packet filter to control radio voice transmission between participants (e.g. range, packet loss).- Parameters:
filter- the packet filter
-
getPacketFilter
Retrieves the current radio packet filter. -
addAudioTransmissionListener
default void addAudioTransmissionListener(@NotNull @NotNull VoiceRadioService.RadioAudioTransmissionListener listener) Registers a listener called whenever radio voice audio is transmitted, providing the processed Opus audio.- Parameters:
listener- (channelName, senderUuid, opusData)
-
isChannelActive
Checks whether a radio channel is currently receiving active voice transmission.- Parameters:
channelName- the channel name- Returns:
- true if currently transmitting
-
startRecording
Starts a voice recording session capturing all transmissions on a radio channel.- Parameters:
channelName- the channel name- Returns:
- the started
VoiceRecording
-
stopRecording
Stops the active voice recording session on a radio channel.- Parameters:
channelName- the channel name- Returns:
- the finished
VoiceRecording, ornullif not recording
-
isRecording
Checks whether a radio channel is currently being recorded.- Parameters:
channelName- the channel name- Returns:
- true if actively recording
-
getActiveRecording
Gets the active recording session for a radio channel, if any.- Parameters:
channelName- the channel name- Returns:
- active
VoiceRecording, ornull
-
playRecordingToRadio
Broadcasts a voice recording across a radio channel to all tuned listeners and external systems.- Parameters:
channelName- the channel namerecording- the recording to play
-
stopRadioPlayback
Stops any ongoing recording playback on a radio channel.- Parameters:
channelName- the channel name
-
isRadioPlaying
Checks whether a radio channel is currently playing back a recording.- Parameters:
channelName- the channel name- Returns:
- true if actively playing
-