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

  1. 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.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.