Skip to content

Commit

Permalink
feat: send ogg as audio
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Jan 17, 2024
1 parent c70d5a3 commit b1bd7ac
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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) {
Expand Down

0 comments on commit b1bd7ac

Please sign in to comment.