Search Issue Tracker

Fixed

Fixed in 2023.2.0a23

Votes

4

Found in

2020.3.46f1

2021.3.20f1

2022.2.9f1

2023.1.0b6

2023.2.0a4

2023.3.0a3

Issue ID

UUM-28836

Regression

No

Certain audio files can have their length halved when they are loaded with UnityWebRequest

--

-

How to reproduce:
1. Open the attached Project "mp3Bug" and load Scene "Main"
2. Enter Play Mode
3. Click the "Open streaming asset file" button in the Game View
4. Observe the value of "Audio length" in the Game View

Expected result: the length is reported to be 174.027s
Actual result: the length is reported to be 87.51s

Reproducible with: 2020.3.46f1, 2021.3.20f1, 2022.2.9f1, 2023.1.0b6, 2023.2.0a4

Notes:
- The Project contains 3 different audio files to test: TestMP3Audio.mp3 (length is reported twice as small as it should be), TestWavAudio.wav (the same audio file with a different format, length is reported correctly) and test.mp3 (length is also reported correctly)
- In the Project you can change the file being loaded by modifying the "File Name In Streaming Assets" variable in the "Audio Manager" Component of the "AudioManager" GameObject in the Scene
- The size of the faulty loaded mp3 file matches the actual file size

  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.

Add comment

Log in to post comment