airmessage / airmessage-android

AirMessage for Android phones, tablets, and laptops
Apache License 2.0
162 stars 20 forks source link

[Bug] Voice messages sent from Android do not render on macOS/iOS #2

Closed sabogalc closed 3 years ago

sabogalc commented 3 years ago

I'm not sure what specific versions of macOS and iOS are affected, but I can confirm that both macOS Big Sur and iOS 14 cannot view or play the audio messages sent from AirMessage. Below is Tagavari's comment from my reddit post.

This is a bug due to the way that newer versions of iOS handle audio messages. I believe that they require some extra metadata that AirMessage isn't able to provide, and so they don't render properly on iOS.

There is a fix available for this bug on the beta channel, and I hope to bring it to stable soon. My apologies for any inconvenience this may have caused.

And here is another post asking a similar question by u/Windows10HomeEdition, https://www.reddit.com/r/AirMessage/comments/mxroep/voice_messages_not_received_by_recipient/

tagavari commented 3 years ago

AirMessage used to send audio messages as Audio Message.amr, which is the same file name that Apple Messages uses. As I mentioned above, I'm guessing that Apple Messages also includes some extra metadata, which causes them to be able to render properly.

The beta version of the app changes the name to Audio message.amr. Unfortunately this causes them to be displayed as an attachment rather than inline, but at least it works.

sabogalc commented 3 years ago

Got it. I think Apple's audio messages are now .caf files, is that correct?

Edit - I just checked in MyMessage, and two audio files were labeled as Audio Message.caf (image below) Audio Also @ericrabil, this screenshot seems to show another instance of issue 33

tagavari commented 3 years ago

Yes, Apple sends audio messages as .caf files. Though if I send an audio message as Audio Message.caf by manually uploading it as an attachment, it doesn't render properly in the Messages app either.

sabogalc commented 3 years ago

Hmm, I guess this would require directly downloading a .caf file and looking at it's file structure. Here is a sample one sent from my iPhone 6S on iOS 14.5

tagavari commented 3 years ago

Thanks for sending the file, though it seems as if any file named Audio Message.caf or Audio Message.amr sent as an attachment won't render properly. It only works if you record and send it directly from Apple Messages' recording feature - even if I use the Messages app on my Mac to record and send an audio message, drag the audio message to Finder to save it as a file, and then upload it to the conversation again as an attachment, it doesn't render.

I haven't looked into it too much, but Apple is able to provide a lot of extra data to be sent with any given message. For example, I sent an audio message through the Messages recorder and inspected my chat database to see that Messages assigned it is_audio_message.

Screenshot

Because of how limited AppleScript is for sending messages, I'm not sure if this is something that's worth the effort to find a workaround for unfortunately.

sabogalc commented 3 years ago

Understood! Thank you for looking into it as much as you did however :). Since the audio messages will send as attachments either way, would it be possible to send them as mp3's or m4a's or something more portable/standard?

tagavari commented 3 years ago

We could switch over to a more common format, but there are advantages to using amr. I just did a bit of testing with different formats by recording a 3-second audio clip, and amr would come out to around 4 KB while m4a would be around 9 KB. amr is designed to be more efficient for voice recordings, which helps it keep its file size down.

Could I ask what the benefits would be to using a more standard format? Since both Android and iOS support amr out-of-the-box and audio messages are usually discarded after hearing them, I don't see how switching to mp3 or m4a would make a difference for users.

sabogalc commented 3 years ago

I see 👍, I didn't know .amr was more efficient in file size and also supported on Android out-of-the-box. I just enjoy standard file extensions since I also use iMessage on Windows (see here), but I agree that for the vast majority of users, it is best to leave it as it is. Thank you!