public void AudioFrameUpdate(float[] data, int channels, bool physicsBasedAttenuation, float directMixFraction,
                                     bool directBinauralEnabled, bool applyAirAbsorption, HRTFInterpolation hrtfInterpolation,
                                     OcclusionMode directOcclusionMode, OcclusionMethod directOcclusionMethod)
        {
            DirectSoundEffectOptions directSoundEffectOptions;

            directSoundEffectOptions.applyDistanceAttenuation = physicsBasedAttenuation ? Bool.True : Bool.False;
            directSoundEffectOptions.applyAirAbsorption       = applyAirAbsorption ? Bool.True : Bool.False;
            directSoundEffectOptions.occlusionMode            = directOcclusionMode;

            AudioBuffer inputBuffer;

            inputBuffer.audioFormat         = inputFormat;
            inputBuffer.numSamples          = data.Length / channels;
            inputBuffer.deInterleavedBuffer = null;
            inputBuffer.interleavedBuffer   = data;

            AudioBuffer outputBuffer;

            outputBuffer.audioFormat         = outputFormat;
            outputBuffer.numSamples          = data.Length / channels;
            outputBuffer.deInterleavedBuffer = null;
            outputBuffer.interleavedBuffer   = data;

            for (int i = 0; i < data.Length; i++)
            {
                data[i] *= directMixFraction;
            }

            PhononCore.iplApplyDirectSoundEffect(directSoundEffect, inputBuffer, directSoundPath,
                                                 directSoundEffectOptions, outputBuffer);

            Vector3 directDirection = directSoundPath.direction;

            if ((outputFormat.channelLayout == ChannelLayout.Stereo) && directBinauralEnabled)
            {
                // Apply binaural audio to direct sound.
                PhononCore.iplApplyBinauralEffect(directBinauralEffect, outputBuffer, directDirection,
                                                  hrtfInterpolation, outputBuffer);
            }
            else if (outputFormat.channelLayout == ChannelLayout.Custom)
            {
                // Apply panning fo custom speaker layout.
                PhononCore.iplApplyPanningEffect(directCustomPanningEffect, outputBuffer, directDirection,
                                                 outputBuffer);
            }
        }