Signal-iOS icon indicating copy to clipboard operation
Signal-iOS copied to clipboard

Incorrect voice messages duration

Open denver-s opened this issue 8 years ago • 9 comments

  • [x] I have searched open and closed issues for duplicates
  • [x] I am submitting a bug report for existing functionality that does not work as intended
  • [x] This isn't a feature request or a discussion topic

Bug description

When a voice message is received, it is shown that the length is (let’s say) 14 seconds, instead the audio will reproduce for 17 seconds.

Steps to reproduce

  • receive a voice message
  • click play to reproduce
  • wait until it reaches the “end”, but it goes on for 3/4 seconds more

Actual result: voice message is longer than expected

Expected result: voice message length should be the exact duration of the audio

Screenshots

45a1a027-0004-49db-9595-8ce07a100bfa

Device info

Device: iPhone 8 Plus

iOS version: 11.4

Signal version: 2.29.0.16 beta

Link to debug log

https://debuglogs.org/56a3b60e3fce2dbdf310b822c27c98bf95c50748b54b9e46efabd977f1950f20.zip

denver-s avatar Aug 25 '18 09:08 denver-s

Can you open a thread with yourself and leave yourself a voice message - does this occur?

Or does it only occur with this one recipient?

Does it occur with every voice message they send you, or just this one?

michaelkirk-signal avatar Aug 31 '18 20:08 michaelkirk-signal

Well, it seems that the problem affects only this particular recipient. He has an Android device (LG G4) with the latest stable version.

No problems when receiving from an iPhone user or sending to myself.

denver-s avatar Sep 01 '18 09:09 denver-s

Seems like they might be sending you a malformed audio file. Do you know what device/OS version they are on?

michaelkirk-signal avatar Sep 04 '18 16:09 michaelkirk-signal

Confirm. Wrong duration with Android client.

cringeops avatar Sep 04 '18 17:09 cringeops

If useful, desktop app shows the correct duration. So maybe it's not caused by a malformed audio file.

denver-s avatar Sep 05 '18 13:09 denver-s

This looks related to #3086. I did a bit of digging into how this might happen; there's some stackoverflow posts about a weird quirk of AVAudioPlayer returning an estimated duration for files it hasn't actually prepared to play (the official docs are silent on this, but I saw a mention of this trait elsewhere as well). @michaelkirk-signal I could make a PR if you want, but I can't reproduce the issue to verify that it works, so it's your call.

Quollified avatar Oct 03 '18 05:10 Quollified

An audio file that reproduces this behavior would be super helpful.

michaelkirk-signal avatar Oct 03 '18 14:10 michaelkirk-signal

@michaelkirk-signal if you need a audio file with incorrect duration you can contact me... [email protected]

SignalFan avatar Oct 07 '18 13:10 SignalFan

Steps to reproduce:

  1. Generate an audio message on Android of sufficient length using Signal, and send it to an iPhone user. You do not need to do this, the attached m4a file will reproduce this behavior.
  2. Unzip and send the attached m4a file to yourself in Signal iOS.
  3. Signal-iOS reports the received file as 26 seconds in length.
  4. Play the file. Actual file duration played is 29 seconds.

It's not clear from the documentation, but AVAudioPlayer apparently won't return an exact length of certain types of audio files without doing a certain amount of preprocessing. I'll make a pull request.

signal-2018-10-24-202801.m4a.zip

Quollified avatar Oct 25 '18 22:10 Quollified