LocationalAudioChannel - SocketSVC Docs
SocketSVC Docs

LocationalAudioChannel

An independent mono speaker.

這一頁還沒有翻譯,以下顯示英文原文。

Generated from source

Interface com.socketsvc.api.LocationalAudioChannel — generated from LocationalAudioChannel.java. Edit the Javadoc in the Java source, then run pnpm gen:api.

package com.socketsvc.api;

public interface LocationalAudioChannel extends AutoCloseable { ... }

An independent mono speaker. Methods are thread-safe; one input source at a time. Does not place a Minecraft block. Close it when its owning block/entity is removed.

Methods

id

UUID id()

setDisplayName

default void setDisplayName(String name)

Rename without changing saved client volume. Plain text, 1..64 characters.

updateLocation

void updateLocation(SpatialPosition position)

setSettings

void setSettings(SpatialSettings settings)

setRecipients

void setRecipients(Set<UUID> recipients)

null = everyone in range; empty = nobody. The set is copied.

forwardMicrophone

void forwardMicrophone(UUID player)

Forward this player's microphone, preserving player volume/mute settings. null disconnects it. Normal proximity speech remains enabled. Sender does not hear their own relay.

sendOpus

void sendOpus(byte[] opus, boolean startOfStream)

One 20 ms mono Opus packet, 1..1275 bytes, paced by caller at 50 Hz. true starts a fresh decoder stream. Rejected while microphone/PCM playback is attached.

play

AudioPlayer play(PcmSource source)

Start a paced PCM source. Rejected if another source is attached; failed calls retain caller ownership.

stopPlayback

void stopPlayback()

isClosed

boolean isClosed()

close

void close()