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
- UI Overlay Image gets darker on each Camera when multiple Cameras are used
- Assertion failed on expression: 'scriptedImporterClass == SCRIPTING_NULL error when opening the standalone profiler window
- Disabled assets in Import Unity Package window aren't tracked but count as being selected by user
- [Windows] Crash on GetManagerFromContext when video is playing and creating High Definition 3D Projects after FMOD failed to switch back to normal output Error appeared
- GC Alloc produced when adding items to MultiColumnListView with Auto Assign Binding
Danny-vda
Jun 05, 2016 22:05
also reproduced on 5.4.0.b20