예제 #1
0
        /* create a new resampler specifier */
        public static ResamplerSpecRec NewResamplerSpecifier(
            ResampleMethodType ResampleMethod,
            ResampOutType OutputMethod,
            double SamplingRate)
        {
#if DEBUG
            if ((ResampleMethod != ResampleMethodType.eResampleTruncating) &&
                (ResampleMethod != ResampleMethodType.eResampleLinearInterpolation))
            {
                Debug.Assert(false);
                throw new ArgumentException();
            }
            if ((OutputMethod != ResampOutType.eResampleRectangular) &&
                (OutputMethod != ResampOutType.eResampleTriangular))
            {
                Debug.Assert(false);
                throw new ArgumentException();
            }
#endif

            ResamplerSpecRec ResamplerSpec = new ResamplerSpecRec();

            ResamplerSpec.SamplingRate = SamplingRate;
            ResamplerSpec.ResampMethod = ResampleMethod;
            ResamplerSpec.OutputMethod = OutputMethod;

            return(ResamplerSpec);
        }
예제 #2
0
 /* add a resampler to the spec list */
 public static void AddResamplerToEffectSpecList(
     EffectSpecListRec EffectSpecList,
     ResamplerSpecRec ResamplerSpec,
     bool EnabledFlag)
 {
     AddGenericToEffectSpecList(EffectSpecList, EffectTypes.eResamplerEffect, ResamplerSpec, EnabledFlag);
 }
예제 #3
0
            public float OldRight;                  /* last left sample from last time */


            /* create a new resampling processor */
            public static ResamplerRec NewResampler(
                ResamplerSpecRec Template,
                SynthParamRec SynthParams)
            {
                ResamplerRec Resampler = new ResamplerRec();

                Resampler.EffectSamplingRate = GetResampleRate(Template);
                Resampler.ResampMethod       = GetResamplingMethod(Template);
                Resampler.OutputMethod       = GetResampleOutputMethod(Template);
                //Resampler.CurrentPhase = 0;
                Resampler.PhaseDifferential = Resampler.EffectSamplingRate / SynthParams.dSamplingRate;
                //Resampler.Left0Value = 0;
                //Resampler.Left1Value = 0;
                //Resampler.Right0Value = 0;
                //Resampler.Right1Value = 0;
                //Resampler.OldLeft = 0;
                //Resampler.OldRight = 0;

                return(Resampler);
            }
예제 #4
0
 /* get sampling rate */
 public static double GetResampleRate(ResamplerSpecRec ResamplerSpec)
 {
     return(ResamplerSpec.SamplingRate);
 }
예제 #5
0
 /* get output generation method */
 public static ResampOutType GetResampleOutputMethod(ResamplerSpecRec ResamplerSpec)
 {
     return(ResamplerSpec.OutputMethod);
 }
예제 #6
0
 /* get resampling method */
 public static ResampleMethodType GetResamplingMethod(ResamplerSpecRec ResamplerSpec)
 {
     return(ResamplerSpec.ResampMethod);
 }
 /* check resampler effect */
 public static SynthErrorCodes CheckResamplerEffectForUnreferencedSamples(
     ResamplerSpecRec ResamplerEffect,
     CheckUnrefParamRec Param)
 {
     return(SynthErrorCodes.eSynthDone);
 }