Example #1
0
        public override void UpdateParameters(SteamAudioSource source)
        {
            if (!mAudioSource)
            {
                return;
            }

            var index = 0;

            mAudioSource.SetSpatializerFloat(index++, (source.distanceAttenuation) ? 1.0f : 0.0f);
            mAudioSource.SetSpatializerFloat(index++, (source.airAbsorption) ? 1.0f : 0.0f);
            mAudioSource.SetSpatializerFloat(index++, (source.directivity) ? 1.0f : 0.0f);
            mAudioSource.SetSpatializerFloat(index++, (source.occlusion) ? 1.0f : 0.0f);
            mAudioSource.SetSpatializerFloat(index++, (source.transmission) ? 1.0f : 0.0f);
            mAudioSource.SetSpatializerFloat(index++, (source.reflections) ? 1.0f : 0.0f);
            mAudioSource.SetSpatializerFloat(index++, (source.pathing) ? 1.0f : 0.0f);
            mAudioSource.SetSpatializerFloat(index++, (float)source.interpolation);
            mAudioSource.SetSpatializerFloat(index++, source.distanceAttenuationValue);
            mAudioSource.SetSpatializerFloat(index++, (source.distanceAttenuationInput == DistanceAttenuationInput.CurveDriven) ? 1.0f : 0.0f);
            mAudioSource.SetSpatializerFloat(index++, source.airAbsorptionLow);
            mAudioSource.SetSpatializerFloat(index++, source.airAbsorptionMid);
            mAudioSource.SetSpatializerFloat(index++, source.airAbsorptionHigh);
            mAudioSource.SetSpatializerFloat(index++, (source.airAbsorptionInput == AirAbsorptionInput.UserDefined) ? 1.0f : 0.0f);
            mAudioSource.SetSpatializerFloat(index++, source.directivityValue);
            mAudioSource.SetSpatializerFloat(index++, source.dipoleWeight);
            mAudioSource.SetSpatializerFloat(index++, source.dipolePower);
            mAudioSource.SetSpatializerFloat(index++, (source.directivityInput == DirectivityInput.UserDefined) ? 1.0f : 0.0f);
            mAudioSource.SetSpatializerFloat(index++, source.occlusionValue);
            mAudioSource.SetSpatializerFloat(index++, (float)source.transmissionType);
            mAudioSource.SetSpatializerFloat(index++, source.transmissionLow);
            mAudioSource.SetSpatializerFloat(index++, source.transmissionMid);
            mAudioSource.SetSpatializerFloat(index++, source.transmissionHigh);
            mAudioSource.SetSpatializerFloat(index++, source.directMixLevel);
            mAudioSource.SetSpatializerFloat(index++, (source.applyHRTFToReflections) ? 1.0f : 0.0f);
            mAudioSource.SetSpatializerFloat(index++, source.reflectionsMixLevel);
            mAudioSource.SetSpatializerFloat(index++, (source.applyHRTFToPathing) ? 1.0f : 0.0f);
            mAudioSource.SetSpatializerFloat(index++, source.pathingMixLevel);
            SetSpatializerIntPtr(source.GetSource().Get(), ref index);
            mAudioSource.SetSpatializerFloat(index++, (source.directBinaural) ? 1.0f : 0.0f);
        }
Example #2
0
        public override void UpdateParameters(SteamAudioSource source)
        {
            FindDSP(source.gameObject);
            if (!mFoundDSP)
            {
                return;
            }

            var ptr = source.GetSource().Get();

            if (IntPtr.Size == sizeof(Int64))
            {
                var ptrValue = ptr.ToInt64();

                mSimulationOutputs[0] = (byte)(ptrValue >> 0);
                mSimulationOutputs[1] = (byte)(ptrValue >> 8);
                mSimulationOutputs[2] = (byte)(ptrValue >> 16);
                mSimulationOutputs[3] = (byte)(ptrValue >> 24);
                mSimulationOutputs[4] = (byte)(ptrValue >> 32);
                mSimulationOutputs[5] = (byte)(ptrValue >> 40);
                mSimulationOutputs[6] = (byte)(ptrValue >> 48);
                mSimulationOutputs[7] = (byte)(ptrValue >> 56);
            }
            else
            {
                var ptrValue = ptr.ToInt32();

                mSimulationOutputs[0] = (byte)(ptrValue >> 0);
                mSimulationOutputs[1] = (byte)(ptrValue >> 8);
                mSimulationOutputs[2] = (byte)(ptrValue >> 16);
                mSimulationOutputs[3] = (byte)(ptrValue >> 24);
            }

            var index = kSimulationOutputsParamIndex;

            FMOD_DSP_setParameterData.Invoke(mDSP, new object[] { index++, mSimulationOutputs });
        }