During development of the splittening, a mechanism was needed to get audio samples from the rendering process back into the main engine process. Two odd behaviors were observed by Frooxius while developing this mechanism for videos playing via Unity's native playback engine:
- Reading all available samples from Unity's video audio buffer causes Unity to generate 64 extra "phantom" samples of duplicate audio data, which increases the sample rate of the audio (ie, 44.1 kHz audio would get read at 45.5 kHz)
- Leaving exactly 64 samples in the buffer causes Unity to crash consistently, for no discernable reason.
To work around these issues, the main process leaves 8 samples in the video audio buffer when reading it. Although leaving a single sample in the buffer also works, 8 was chosen because it is a "nicer number."