signalapp / Signal-iOS

A private messenger for iOS.
https://signal.org
GNU Affero General Public License v3.0
10.6k stars 2.95k forks source link

Opus files cannot be played #5771

Open avidseeker opened 3 months ago

avidseeker commented 3 months ago

Let's begin with a checklist: Replace the empty checkboxes [ ] below with checked ones [x] accordingly. -->


Bug description

Opus files cannot be played from iPhone

Steps to reproduce

Actual result: clicking the recording doesn't play it

Expected result: plays just like Android

Screenshots

Device info

Device: iPhone 12

iOS version: 17

Signal version: 7.1

Miguel-Signal commented 3 months ago

Hi @avidseeker

Could you please write into support@signal.org with a link to your debug logs and reference this github issue?

To share a debug log from Signal iOS, tap your profile, Settings, Help, Submit Debug Log, Copy Link.

iromeister commented 1 month ago

I don't use iOS myself, but my friends do. I can confirm this and it's really annoying. I share a voice message from Telegram or WhatsApp to Signal on my Android phone, which works as expected there. But my iOS friends cannot play the voice message on their phones.

rubdos commented 1 week ago

Would adding Opus/Ogg/Vorbis to the supported mime type lists be enough to get over this issue? I don't have any iOS development experience, but I imagine supporting (and using) Opus might relieve some storage stress. Context for me: I'm implementing sending voice notes in Whisperfish, and it'd be rather neat if we could use Opus.

diff --git a/SignalServiceKit/src/Util/MIMETypeUtil.m b/SignalServiceKit/src/Util/MIMETypeUtil.m
index 0511962325..617eaee37e 100644
--- a/SignalServiceKit/src/Util/MIMETypeUtil.m
+++ b/SignalServiceKit/src/Util/MIMETypeUtil.m
@@ -85,6 +85,7 @@ NSString *const kLottieStickerFileExtension = @"lottiesticker";
             @"audio/x-aiff" : @"aiff",
             @"audio/3gpp2" : @"3g2",
             @"audio/3gpp" : @"3gp",
+            @"audio/ogg" : @"ogg",
         };
     });
     return result;
@@ -180,7 +181,9 @@ NSString *const kLottieStickerFileExtension = @"lottiesticker";
             @"bwf" : @"audio/wav",
             @"m4a" : @"audio/x-m4a",
             @"m4b" : @"audio/x-m4b",
-            @"m4p" : @"audio/x-m4p"
+            @"m4p" : @"audio/x-m4p",
+            @"ogg" : @"audio/ogg",
+            @"opus" : @"audio/ogg",
         };
     });
     return result;