Search Issue Tracker
By Design
Votes
4
Found in
5.3.4f1
Issue ID
800264
Regression
No
AudioSource.GetOutputData returns an empty array the first time it is called
Reproduction steps:
1. Open the attached project
2. Open the "GetOutputData" Scene
3. Play
4. Notice that GameObject GetOutputData has an Audio Samples array which is full of zeros
5. Press Q to call AudioSource.GetOutputData function
6. Notice that AudioSamples array is still empty
7. Press Q again and notice that AudioSamples array has received data
Actual result: AudioSource.GetOutputData returns an empty array the first time it is called
Expected result: an array is expected to be filled the first time GetOutputData is called
Workaround: Calling this function twice returns audio data as expected
Reproduced on: 5.1.4f1, 5.2.4f1, 5.3.5p1, 5.4.0b19
By design: GetAudioData returns whatever is playing in the history buffer of the sound playing. If it wasn't that, it would have to be a consume operation or part of the mixer thread.
Considering that this is called before the sound is playing, the history buffer is naturally 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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Danny-vda
Jun 05, 2016 22:05
also reproduced on 5.4.0.b20