# PcmSources

Class PcmSources in com.socketsvc.client.api

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

```java
package com.socketsvc.client.api;

public final class PcmSources { ... }
```

## Methods

### file

```java
public static PcmSource file(Path path)
```

Lazily opens a local sound file (WAV, AIFF, ...) using Java Sound and converts to 48 kHz mono PCM.
Unsupported file/conversion errors are reported by AudioPlayer.completion(). No network I/O.

### stream

```java
public static PcmSource stream(InputStream in)
```

As `#file(Path)`, but reads from an already-open stream (e.g. a mod's bundled resource).
The stream is closed once playback ends, whether by EOF, stop() or a read failure.