From 86f46ece830cf0fb7b51a047cbea112e791811f7 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 29 Sep 2023 18:42:26 +0200 Subject: [PATCH] revert back to AAC for voice messages iOS can not do opus out of the box --- src/main/java/eu/siacs/conversations/Config.java | 4 ++++ .../java/eu/siacs/conversations/ui/RecordingActivity.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java index 812f6ae10..2299c3adb 100644 --- a/src/main/java/eu/siacs/conversations/Config.java +++ b/src/main/java/eu/siacs/conversations/Config.java @@ -83,6 +83,8 @@ public final class Config { public static final boolean XEP_0392 = true; //enables XEP-0392 v0.6.0 + + // media file formats. Homogenous Android or Conversations only deployments can switch to opus and webp public static final int AVATAR_SIZE = 192; public static final Bitmap.CompressFormat AVATAR_FORMAT = Bitmap.CompressFormat.JPEG; public static final int AVATAR_CHAR_LIMIT = 9400; @@ -91,6 +93,8 @@ public final class Config { public static final Bitmap.CompressFormat IMAGE_FORMAT = Bitmap.CompressFormat.JPEG; public static final int IMAGE_QUALITY = 75; + public static final boolean USE_OPUS_VOICE_MESSAGES = false; + public static final int MESSAGE_MERGE_WINDOW = 20; public static final int PAGE_SIZE = 50; diff --git a/src/main/java/eu/siacs/conversations/ui/RecordingActivity.java b/src/main/java/eu/siacs/conversations/ui/RecordingActivity.java index 085765163..df3dabdce 100644 --- a/src/main/java/eu/siacs/conversations/ui/RecordingActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/RecordingActivity.java @@ -99,7 +99,7 @@ public class RecordingActivity extends Activity implements View.OnClickListener mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); final int outputFormat; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + if (Config.USE_OPUS_VOICE_MESSAGES && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { outputFormat = MediaRecorder.OutputFormat.OGG; mRecorder.setOutputFormat(outputFormat); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.OPUS);