Search Issue Tracker
By Design
Votes
3
Found in
2019.4
2020.3
2020.3.12f1
2021.1
2021.2
2022.1
Issue ID
1345650
Regression
No
Information about Audio Clips loaded using a UnityWebRequest is lost after calling AudioSettings.Reset()
Reproduction steps:
1. Open the attached project "Case_1345650" and load Scene "SampleScene"
2. Enter Play Mode
3. Click the "Get Streaming Sound" button
4. Click the "Play Streaming Sound" button
5. Observe the information about the AudioClip in the Console and the Audio Clip playing
6. Click the "Activate" button
7. Click the "Play Streaming Sound" button
8. Observe the Console again
Expected result: The Audio Clip plays and all of the information about the Audio Clip logged remains the same
Actual result: The Audio Clip does not play and the information in the Console differs
Reproducible with: 2019.4.29f1, 2020.3.14f1, 2021.1.14f1, 2021.2.0b3, 2022.1.0a1
Could not test with: 2018.4 (Project's UI breaks)
Note:
- Issue was originally found on iOS when calling UnitySetAudioSessionActive(1), however, calling AudioSettings.Reset() shows the exact same behavior and offers an easier reproduction
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
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
Resolution Note:
Only disk-based AudioClips get automatically reloaded, all other audio clip types created using WWW.GetAudioClip or AudioClip.Create, but also audio clips associated with Microphone are volatile and will be lost when a script- or user-induced reset happens (the latter could be plugging in headphones/HDMI device with mismatching sample rate or speaker format, or changing OS sound system settings).
See the note about the OnAudioConfigurationChanged callback (and the example) in https://docs.unity3d.com/ScriptReference/AudioSettings.Reset.html for how to react on device changes. In this case you would need to keep track of and reload all WWW streams from here.