Contents
Class ClipPlayback
java.lang.Object
com.hypixel.hytale.server.core.modules.voice.ClipPlayback
Handle for a clip queued via
VoiceSpeaker.play(List). The voice module paces the clip's frames one
per 20Lms so the client jitter buffer is not overrun. Use
cancel() to stop early and completion to chain follow-up work or clean up.-
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Stops the clip and resolvescompletionexceptionally with aCancellationException.Completes when the final frame has been queued to the client (not when client-side playback ends), or when the speaker closes first.booleanisDone()Whether the clip has reached a terminal state: all frames pushed, the speaker closed, cancelled, or dropped after an error.
-
Method Details
-
cancel
public void cancel()Stops the clip and resolvescompletionexceptionally with aCancellationException. Frames already handed to the speaker may still play out on the client. Idempotent; a clip that already finished is unaffected. -
isDone
public boolean isDone()Whether the clip has reached a terminal state: all frames pushed, the speaker closed, cancelled, or dropped after an error. -
completion
Completes when the final frame has been queued to the client (not when client-side playback ends), or when the speaker closes first. Completes exceptionally ifcancel()runs first or the clip is dropped after an error; observe it withCompletionStage.whenComplete(BiConsumer)orCompletionStage.exceptionally(Function)(the cancel cause is aCancellationException, delivered per theCompletionStageconvention). Continuations run on an unspecified server thread, may run synchronously on the thread that completes or cancels the clip, and so must not block. The returned stage cannot be completed or cancelled by callers; usecancel().
-