From b1bd7acfb8df502f7d653b228e106b729bb2462a Mon Sep 17 00:00:00 2001 From: xtaodada Date: Wed, 17 Jan 2024 23:02:12 +0800 Subject: [PATCH] feat: send ogg as audio --- .../java/org/telegram/messenger/SendMessagesHelper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java b/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java index e6560b15ac..8987ad4ff9 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java @@ -6637,7 +6637,7 @@ private static int prepareSendingDocumentInternal(AccountInstance accountInstanc String title = null; boolean isVoice = false; int duration = 0; - if (extL.equals("mp3") || extL.equals("m4a")) { + if (extL.equals("mp3") || extL.equals("m4a") || extL.equals("ogg") || extL.equals("flac")) { AudioInfo audioInfo = AudioInfo.getAudioInfo(f); if (audioInfo != null) { long d = audioInfo.getDuration(); @@ -6647,7 +6647,7 @@ private static int prepareSendingDocumentInternal(AccountInstance accountInstanc duration = (int) (d / 1000); } } - } else if (extL.equals("opus") || extL.equals("ogg") || extL.equals("flac")) { + } else if (extL.equals("opus")) { MediaMetadataRetriever mediaMetadataRetriever = null; try { mediaMetadataRetriever = new MediaMetadataRetriever(); @@ -6658,7 +6658,7 @@ private static int prepareSendingDocumentInternal(AccountInstance accountInstanc title = mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_TITLE); permormer = mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ARTIST); } - if (editingMessageObject == null && extL.equals("ogg") && MediaController.isOpusFile(f.getAbsolutePath()) == 1) { + if (editingMessageObject == null && MediaController.isOpusFile(f.getAbsolutePath()) == 1) { isVoice = true; } } catch (Exception e) {