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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
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.