MicrophoneTap
A consumer of players' inbound microphone audio, registered through subscribeMicrophone.
這一頁還沒有翻譯,以下顯示英文原文。
Generated from source
Interface com.socketsvc.api.MicrophoneTap — generated from MicrophoneTap.java. Edit the Javadoc in the Java source, then run pnpm gen:api.
package com.socketsvc.api;
public interface MicrophoneTap { ... }A consumer of players' inbound microphone audio, registered through
subscribeMicrophone.
This is the one API SocketSVC has that reads a player rather than writes to one, and
it is gated accordingly: the microphone-tap.enabled switch is off until an operator
turns it on, socketsvc.bridge decides whose audio may leave the system at all, and
every subscription is announced in the server log. A tap sees only what the relay was already
willing to send on - a muted player, a player without socketsvc.speak, and a player
whose socketsvc.bridge was taken away all reach it as silence rather than as frames.
Callbacks run on the voice relay's network thread, once per 20 ms per talking player. Do not block in them and do not touch the server's world or entity state from them: hand the frame to your own queue and leave. A tap that throws is closed and the failure logged, rather than being allowed to take the relay down with it.
Methods
onAudio
void onAudio(MicrophoneAudio audio)One frame from one speaker. See MicrophoneAudio on why its arrays must not be
written to.
onSpeakerGone
default void onSpeakerGone(UUID speaker)This speaker has stopped talking, disconnected, or been silenced - whatever was being
accumulated for them can be flushed. Never called without a preceding #onAudio.
Nested types
enum Format