// Initialize these somewhere MP4Recorder videoRecorder; IClock clock; void OnAudioFilterRead (float[] data, int channels) { // Invoked by Unity // Send to recorder for encoding videoRecorder?.CommitSamples(data, clock.Timestamp); }