Search Issue Tracker


Fixed in 2023.2.0a23



Found in




Issue ID




AudioClip Length is twice the size when by using UnityWebRequestMultimedia.GetAudioClip from Firebase Storage



How to reproduce:
1. Open the attached project's Scene labeled "SampleScene"
2. Enter the Play Mode
3. Inspect the Console Window

Expected result: AudioClip size downloaded from Firebase is similar to other sources
Actual result: AudioClip size is double compared to other sources

Reproducible with: 2018.4.36f1, 2019.4.27f1, 2020.3.9f1, 2021.1.8f1, 2021.2.0a17

  1. Resolution Note (fix version 2023.2.0a23):

    MPEG codec length estimation was improved by averaging frame sizes of the first 100 frames instead of looking at only the first one.

Comments (8)

  1. wechat_os_Qy04MgUep58p-beA8MNP3yJVs

    Jul 17, 2023 09:02


  2. SeventhString

    May 29, 2023 14:02

    We got a fix for this, just pushing in through the grinder to land it in the latest version, then we'll get to work on backports.

  3. yusuf_unity70

    May 26, 2023 15:13

    Any updated? @unity-team

  4. Chris-V

    Apr 13, 2023 21:47

    I'm also seeing this issue in 2021.3.19f1. From what I can tell it seems to be a function of the sampling rate of the source audio file. The length seems to be correct if the source is 44KHz, but doubled if the source is 22KHz. Presumably other sampling rates will produce other incorrectness factors. Haven't tested extensively so could be wrong about this. I am seeing this when using DownloadHandlerAudioClip.GetContent with mp3 files. Does the download handler make assumptions about the sampling rate?

  5. NAKAS

    Sep 28, 2022 22:14

    Hey just reporting about a similar issue I have been running into when I create a clip with samples that I pulled from a unity video using the audio sample provider in the experimental audio section.

    I get the samples from the audio thread and then create an audio clip with provider.channelcount (in my case it's a stereo clip) the clip that gets created is twice as long as the audio samples and has blank audio in the second half of the clip after AudioClip.setdata. It seems like a slightly different scenario but the AudioClip being created twice as long issue seems the same and related.

  6. ickydime

    Jul 25, 2022 18:15

    Linking back to this thread for anyone to discuss workarounds as its been over a year now since reported:

  7. DaveA_VR

    Jun 11, 2022 00:28

    In 2021.3.0f I'm seeing length 0. AudioClip is invalid. I am not using FIrebase, just UnityWebRequestMultimedia.GetAudioClip

  8. GoDJOHN

    Jul 21, 2021 23:13

    When trying to recreate waveform, the double count of samples makes so difficult to handle the amount of data in order to get left and right channel on interlaced audio.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.