element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
GNU Affero General Public License v3.0
10.99k stars 1.95k forks source link

"Error downloading audio" when recording a voice mesage #24904

Open RayBB opened 1 year ago

RayBB commented 1 year ago

Steps to reproduce

  1. I was in a 1:1 non encrypted chat
  2. I clicked the button to record a voice message twice and talked for about a minute.
  3. When I clicked stop recording it said: "Error downloading audio"

Note: This was the first time I send a voice memo since I opened the app. The 2nd attempt to send a voice message worked fine.

image

https://user-images.githubusercontent.com/921217/227150048-aba5c4d7-475b-4363-9ea5-9acfefb56c56.mp4

Outcome

What did you expect?

To be able to listen to and send my audio

What happened instead?

Can't listen to my audio or send it

Operating system

macOS

Application version

1.11.25

How did you install the app?

https://packages.riot.im/desktop/install/macos/Element.dmg

Homeserver

matrix.org

Will you send logs?

Yes

madduck commented 4 months ago

I have the same problem on 1.11.65 on Linux, using Firefox:

image

It's notworthy that I can download the file and it'll play just fine in VLC, so not sure what the error actually is.

t3chguy commented 4 months ago

so not sure what the error actually is.

Without sharing the logs, neither do we.

t3chguy commented 4 months ago

The original logs for this issue have expired

madduck commented 4 months ago

Let me know what you need. There is nothing in the browser console, and /rageshake doesn't work:

image

PS: I accidentally filed this under "not in a browser" but I am actually just using Firefox, with my own 1.11.65.

t3chguy commented 4 months ago

@madduck you didn't file this issue, it was filed in 2023 by @RayBB.

If you want to contribute logs to this such that it isn't closed you'd need to reproduce on a client with rageshake configured, e.g. app.element.io or better yet develop.element.io

madduck commented 4 months ago

Done, submitted via develop

t3chguy commented 4 months ago
2024-04-26T11:08:37.408Z E Error decoding recording:  The buffer passed to decodeAudioData contains an unknown content type. (EncodingError | 0)
2024-04-26T11:08:37.408Z W Trying to re-encode to WAV instead...
2024-04-26T11:08:37.408Z D Decoder WASM path: https://develop.element.io/bundles/d45bd6959fe3a2a3b9d2/../../decoderWorker.min.wasm
2024-04-26T11:08:37.408Z E Caught decoding error: attempting to access detached ArrayBuffer
./matrix-react-sdk/src/audio/compat.ts/decodeOgg/<@https://develop.element.io/bundles/d45bd6959fe3a2a3b9d2/bundle.js:206308:24
decodeOgg@https://develop.element.io/bundles/d45bd6959fe3a2a3b9d2/bundle.js:206305:10
./matrix-react-sdk/src/audio/Playback.ts/prepare/this.audioBuf</<@https://develop.element.io/bundles/d45bd6959fe3a2a3b9d2/bundle.js:205555:58

2024-04-26T11:08:37.408Z E Error processing audio file: attempting to access detached ArrayBuffer
./matrix-react-sdk/src/audio/compat.ts/decodeOgg/<@https://develop.element.io/bundles/d45bd6959fe3a2a3b9d2/bundle.js:206308:24
decodeOgg@https://develop.element.io/bundles/d45bd6959fe3a2a3b9d2/bundle.js:206305:10
./matrix-react-sdk/src/audio/Playback.ts/prepare/this.audioBuf</<@https://develop.element.io/bundles/d45bd6959fe3a2a3b9d2/bundle.js:205555:58

2024-04-26T11:08:37.425Z error Unhandled promise rejection: EncodingError: The buffer passed to decodeAudioData contains an unknown content type.

@madduck can you share the View Source for the impacted event?

madduck commented 4 months ago

@t3chguy here you go:

{
  "type": "m.room.message",
  "content": {
    "body": "Voice message",
    "msgtype": "m.audio",
    "file": {
      "v": "v2",
      "key": {
        "alg": "A256CTR",
        "ext": true,
        "k": "tWZbUUgu7YqooPNuRAKb0E7sAjnjCLgUa8oqW5DN-Wk",
        "key_ops": [
          "encrypt",
          "decrypt"
        ],
        "kty": "oct"
      },
      "iv": "OSgZsfltb3AAAAAAAAAAAA",
      "hashes": {
        "sha256": "oRhIs49cQkE1BA+wx3IxVTYuaW1/HvHibKNtBNxCcWQ"
      },
      "url": "mxc://madduck.net/ZiNdsIhUUhucVCdjMepQPzrF"
    },
    "info": {
      "duration": 2817,
      "mimetype": "audio/ogg",
      "size": 3385
    },
    "org.matrix.msc1767.text": "Voice message",
    "org.matrix.msc1767.file": {
      "file": {
        "v": "v2",
        "key": {
          "alg": "A256CTR",
          "ext": true,
          "k": "tWZbUUgu7YqooPNuRAKb0E7sAjnjCLgUa8oqW5DN-Wk",
          "key_ops": [
            "encrypt",
            "decrypt"
          ],
          "kty": "oct"
        },
        "iv": "OSgZsfltb3AAAAAAAAAAAA",
        "hashes": {
          "sha256": "oRhIs49cQkE1BA+wx3IxVTYuaW1/HvHibKNtBNxCcWQ"
        },
        "url": "mxc://madduck.net/ZiNdsIhUUhucVCdjMepQPzrF"
      },
      "name": "Voice message.ogg",
      "mimetype": "audio/ogg",
      "size": 3385
    },
    "org.matrix.msc1767.audio": {
      "duration": 2817,
      "waveform": [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ]
    },
    "org.matrix.msc3245.voice": {},
    "m.mentions": {}
  }
}
RinCat commented 3 months ago

I encountered a similar issue. A user was sending multiple voice and it shows Error downloading audio after a few working ones.

The ogg file can be downloaded. The format looks ogg:

file Voice message.ogg 

Voice message.ogg: Ogg data, Opus audio, version 0.1, mono, 48000 Hz (Input Sample Rate)

But data invalid:

ffprobe Voice message.ogg          

ffprobe version 6.1.1 Copyright (c) 2007-2023 the FFmpeg developers
[ogg @ 0x5603710fa240] Cannot identify new stream
[ogg @ 0x5603710fa240] failed to create or replace stream
Voice message.ogg: Invalid data found when processing input

So it seems either ogg encoding issue or file decrypt issue.