audioCodec
info
Added in Scrcpy 2.0
- Type:
-
"raw" | "opus" | "aac"(until 2.3) -
"raw" | "opus" | "aac" | "flac"(since 2.3)
-
- Default value:
"opus"
Specifies the audio codec to use by the server.
Different audio codecs provide different trade-offs between quality, compression, and compatibility:
opus: Opus audio codec, provides good quality at low bitratesraw: Raw audio, uncompressed but high qualityaac: AAC audio codec, widely supported-
flac: FLAC audio codec, provides lossless compression(since 2.3)
The specified audioCodec must be supported by the device (has an encoder for it), otherwise an error will be thrown in the startup process.
Related options
audio: Controls whether audio is enabledaudioBitRate: Controls the audio bitratevideoCodec: Specifies the video codec to use
Changelog
v2.3
Added support for "flac" audio codec.
Example
import { ScrcpyOptions2_0 } from "@yume-chan/scrcpy";
const options = new ScrcpyOptions2_0({
audioCodec: "aac", // Use AAC audio codec
});