setParameterFloat() 공개 메소드

public setParameterFloat ( int index, float value ) : RESULT
index int
value float
리턴 RESULT
예제 #1
0
        public static EqualizerBand GetEqualizerBand(FMOD.System system, bool isActive, float centerValue, float bandwithValue, float gainValue)
        {
            FMOD.DSP dspParamEq = null;

            if (isActive)
            {
                if (!system.createDSPByType(FMOD.DSP_TYPE.PARAMEQ, out dspParamEq).ERRCHECK())
                {
                    return(null);
                }

                FMOD.ChannelGroup masterChannelGroup;
                if (!system.getMasterChannelGroup(out masterChannelGroup).ERRCHECK())
                {
                    return(null);
                }

                int numDSPs;
                if (!masterChannelGroup.getNumDSPs(out numDSPs).ERRCHECK())
                {
                    return(null);
                }

                if (!masterChannelGroup.addDSP(numDSPs, dspParamEq).ERRCHECK())
                {
                    return(null);
                }

                if (!dspParamEq.setParameterFloat((int)FMOD.DSP_PARAMEQ.CENTER, centerValue).ERRCHECK())
                {
                    return(null);
                }

                if (!dspParamEq.setParameterFloat((int)FMOD.DSP_PARAMEQ.BANDWIDTH, bandwithValue).ERRCHECK())
                {
                    return(null);
                }

                if (!dspParamEq.setParameterFloat((int)FMOD.DSP_PARAMEQ.GAIN, gainValue).ERRCHECK())
                {
                    return(null);
                }

                if (!dspParamEq.setActive(true).ERRCHECK())
                {
                    return(null);
                }
            }

            var band = new EqualizerBand(system, dspParamEq, centerValue, gainValue, isActive);

            return(band);
        }
예제 #2
0
    public void SetSpeed(float speed)
    {
        decimal speedDec = Convert.ToDecimal(speed);

        speedDec = Math.Round(speedDec, 1);
        speed    = (float)speedDec;

        if (Channel != null)
        {
            Channel.setFrequency(_defaultFrequency * speed);
            _pitchShift.setParameterFloat(PITCH_INDEX, 1.0f / speed);
        }

        Speed = speed;
    }