Interface AudioPlayer
public interface AudioPlayer
Streams audio data from the server to clients.
A player instance can be obtained by calling
VoicechatServerApi.createAudioPlayer(de.maxhenkel.voicechat.api.audiochannel.AudioChannel, de.maxhenkel.voicechat.api.opus.OpusEncoder, java.util.function.Supplier<short[]>)
.-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
boolean
void
setOnStopped
(Runnable onStopped) void
Starts playing/streaming the audio.void
Stops playing/streaming the audio.
-
Method Details
-
startPlaying
void startPlaying()Starts playing/streaming the audio. -
stopPlaying
void stopPlaying()Stops playing/streaming the audio. -
isStarted
boolean isStarted()- Returns:
- if the player has been started
-
isPlaying
boolean isPlaying()- Returns:
- if the audio is still playing
-
isStopped
boolean isStopped()- Returns:
- if the player stopped playing
-
setOnStopped
- Parameters:
onStopped
- a runnable that's called when the player is finished playing
-