Search Issue Tracker
By Design
By Design in 6000.3.X
Votes
2
Found in
2021.3.41f1
2022.3.40f1
6000.0.13f1
6000.1.0a2
6000.2.0a1
6000.3.0a1
Issue ID
UUM-77163
Regression
No
Turning off "Preload Audio Data" results in an "Cannot create FMOD::Sound instance for clip" error when AudioClip is loaded from an asset bundle
How to reproduce:
1. Open the attached “IN-81310” Project
2. Open the “TestAudioAssetBundle” scene
3. Enter Play mode
4. Select the “PreloadOff” button in the UI
5. Observe the error in the Console window
Expected result: Using an Asset Bundle for loading Audio Clips causes no issues whether “Preload Audio Data” is turned on or off
Actual result: Turning off “Preload Audio Data” makes audio playback fail
Reproducible in: 2021.3.41f1, 2022.3.40f1, 6000.0.13f1
Reproducible on: Windows 10, Windows 11
Not reproducible on: No other environments tested
Notes: also reproducible in Player
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Animator state transition preview clips are flickering when zooming in
- [Tile Palette] Sprites not rendering when brush tool "Paint a filled box with active brush" is used for the first time
- Adding available Nodes with longer names in Fragment Context window overflow Fragment Context window in Shader Graph
- Longer Shader Graph Property Reference names breaks VFX Graph Output Particle Node
- "DebugAllocatorMode" option changes when changed in another Editor instance
Resolution Note:
The bug raised comes from an issue in the Utage package, used in the repro project. Its asset loading system does not handle the scenario where an asset bundle item does not come in preloaded. When the item is deserialized from the bundle, even if the AudioClip instance exists, it's still dissociated from its data. When `preloadAudioData == false`, this means that the audio data as to be explicitely loaded in FMOD to be available. In AssetFileUtage.LoadAsset, adding a verification for this value to call AudioClip.LoadAudioData() if necessary fixes the issue.
Another potential fix would have been to keep the audio asset bundle loaded until the play time, because the virtual file system handler responsible for reading asset bundles would still be available to load and read the file on the fly.
In a simple Unity project, the scenario described in the bug causes no issue.
Resolution Note (6000.3.X):
The bug raised comes from an issue in the Utage package, used in the repro project. Its asset loading system does not handle the scenario where an asset bundle item does not come in preloaded. When the item is deserialized from the bundle, even if the AudioClip instance exists, it's still dissociated from its data. When `preloadAudioData == false`, this means that the audio data as to be explicitely loaded in FMOD to be available. In AssetFileUtage.LoadAsset, adding a verification for this value to call AudioClip.LoadAudioData() if necessary fixes the issue.
Another potential fix would have been to keep the audio asset bundle loaded until the play time, because the virtual file system handler responsible for reading asset bundles would still be available to load and read the file on the fly.
In a simple Unity project, the scenario described in the bug causes no issue.