Unity Issue Tracker - Certain audio files can have their length halved when they are loaded with UnityWebRequest
Fixed
UUM-28836
Certain audio files can have their length halved when they are loaded with UnityWebRequest
Unity: Platform Audio
Fixed
2023.2.X
Won't Fix
2023.3.X
2023.1.X
2022.3.X
2022.2.X
2021.3.X
2020.3.X
This issue was previously fixed in 2023.2
MPEG codec length estimation was improved by averaging frame sizes of the first 100 frames instead of looking at only the first one.
Already fixed in 2022.3.17f1
Already fixed in 2021.3.34f1
2020.3 is reaching the end of its life, so closing this back-port.
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
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
Prioritise and Follow this issue
Have a workaround or additional info about this issue?