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
- Character spacing value is not applied when using a specific font asset
- [Android][IL2CPP] Player crashes on __memcpy_aarch64_simd+276 when invoking native code via a plugin on some ARM64 Android devices
- [Android]Resources fail to load when the AAB build contains a large Addressables Bundle
- Unity is loading internal version of SharpZipLib instead of local version
- The Context Menu items are ordered incorrectly
Danny-vda
Jun 05, 2016 22:05
also reproduced on 5.4.0.b20