# LocationalAudioChannel

An independent mono speaker.

Source: https://socketsvc.vercel.app/zh-TW/api/shared/LocationalAudioChannel
<Callout title="Generated from source">
  Interface `com.socketsvc.api.LocationalAudioChannel` — generated from [LocationalAudioChannel.java](https://github.com/HippoDev03/SocketSVC/blob/main/common/core/src/main/java/com/socketsvc/api/LocationalAudioChannel.java). Edit the Javadoc in the Java source, then run `pnpm gen:api`.
</Callout>

```java
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

```java
UUID id()
```

### setDisplayName

```java
default void setDisplayName(String name)
```

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

### updateLocation

```java
void updateLocation(SpatialPosition position)
```

### setSettings

```java
void setSettings(SpatialSettings settings)
```

### setRecipients

```java
void setRecipients(Set<UUID> recipients)
```

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

### forwardMicrophone

```java
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

```java
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

```java
AudioPlayer play(PcmSource source)
```

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

### stopPlayback

```java
void stopPlayback()
```

### isClosed

```java
boolean isClosed()
```

### close

```java
void close()
```