Search Issue Tracker
By Design
Votes
0
Found in
2021.3.38f1
2022.3.29f1
6000.0.2f1
Issue ID
UUM-72367
Regression
No
Empty data buffer gets passed to OnAudioFilterRead when using Video Player
Reproduction steps:
1. Open the attached "ReproProj" project
2. Open the “Assets/Scenes/SampleScene” scene
3. Open the “Assets/ingest” script
4. In the Code editor, attach the Unity Debugger (In Visual Studio it’s done by clicking on the “Attach to Unity” button)
5. Enter the Play mode
6. In the Code editor, insert a breakpoint at the line 9 of the “ingest” script
7. Once it reaches the breakpoint, inspect the data buffer in the Autos window
8. Observe the results
Expected Result: The data buffer is not empty
Actual Result: The data buffer is empty
Reproducible with: 2021.3.38f1, 2022.3.29f1, 6000.0.2f1
Reproducible on: Windows 11 Pro
Not reproducible on: No other environments tested
Note: When the “ingest” script is disabled in the “Audio Source” GameObject before entering the Play mode, and then enabled after entering the Play mode, the data buffer is not empty
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
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
Resolution Note:
On AudioSources that don't have a clip attached, the first MonoBehaviour that has the OnAudioFilterRead method implemented is considered a generator. As such, it doesn't receive the contributions of other inputs to the AudioSource. The second MonoBehaviour-with-OnAudioFilterRead will reliably receive the VideoPlayer's input signal (the first MonoBehaviour-with-OnAudioFilterRead can be left empty to generate silence). Another approach is to never invoke AudioSource.Play (this includes turning playOnAwake off). This entry point in the AudioSource is where the logic to identify audio generators is executed, so not running this will have the first MonoBehaviour-with-OnAudioFilterRead remain considered as a filter, thus receiving the attached VideoPlayer signal.