Skip to main content
Version: next

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 bitrates
  • raw: Raw audio, uncompressed but high quality
  • aac: 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.

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
});