From 38900d77307d24690168ad05e4f95fe238d9e83a Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 24 May 2023 21:31:47 +0200 Subject: [PATCH] Extract audio source to a static constant For consistency with the other parameters. --- server/src/main/java/com/genymobile/scrcpy/AudioCapture.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/AudioCapture.java b/server/src/main/java/com/genymobile/scrcpy/AudioCapture.java index dbb38dd2..ef9ef30d 100644 --- a/server/src/main/java/com/genymobile/scrcpy/AudioCapture.java +++ b/server/src/main/java/com/genymobile/scrcpy/AudioCapture.java @@ -18,6 +18,7 @@ import java.nio.ByteBuffer; public final class AudioCapture { + public static final int SOURCE = MediaRecorder.AudioSource.REMOTE_SUBMIX; public static final int SAMPLE_RATE = 48000; public static final int CHANNEL_CONFIG = AudioFormat.CHANNEL_IN_STEREO; public static final int CHANNELS = 2; @@ -50,7 +51,7 @@ public final class AudioCapture { // On older APIs, Workarounds.fillAppInfo() must be called beforehand builder.setContext(FakeContext.get()); } - builder.setAudioSource(MediaRecorder.AudioSource.REMOTE_SUBMIX); + builder.setAudioSource(SOURCE); builder.setAudioFormat(createAudioFormat()); int minBufferSize = AudioRecord.getMinBufferSize(SAMPLE_RATE, CHANNEL_CONFIG, FORMAT); // This buffer size does not impact latency