Exemple #1
0
		public ResamplerPullBuffer(R8BrainSampleRateConverter converter)
			: base(4096)
		{
			FConverter = converter;
			
			//calculate needed input samples per buffer
			var ratio = FConverter.SourcRate / FConverter.DestinationRate;
			PullCount = (int)(AudioService.Engine.Settings.BufferSize * ratio * 2) ;
			
			//fill the buffer with the first pull
			Pull(FConverter.Latency + PullCount);
		}
Exemple #2
0
        public ResamplerPullBuffer(R8BrainSampleRateConverter converter)
            : base(4096)
        {
            FConverter = converter;

            //calculate needed input samples per buffer
            var ratio = FConverter.SourcRate / FConverter.DestinationRate;

            PullCount = (int)(AudioService.Engine.Settings.BufferSize * ratio * 2);

            //fill the buffer with the first pull
            Pull(FConverter.Latency + PullCount);
        }
Exemple #3
0
 public void SetupConverter(double srcRate, double dstRate, double reqTransBand = 3)
 {
     if (DestinationRateIsEngineRate)
     {
         dstRate = WaveFormat.SampleRate;
     }
     if (FConverter == null || FConverter.SourcRate != srcRate || FConverter.DestinationRate != dstRate)
     {
         FConverter        = new R8BrainSampleRateConverter(srcRate, dstRate, 4096, reqTransBand, R8BrainResamplerResolution.R8Brain24);
         FPullBuffer       = new ResamplerPullBuffer(FConverter);
         FPullBuffer.Input = InputSignal.Value;
     }
 }
Exemple #4
0
		public void SetupConverter(double srcRate, double dstRate, double reqTransBand = 3)
		{
			if (DestinationRateIsEngineRate)
				dstRate = WaveFormat.SampleRate;
			if (FConverter == null || FConverter.SourcRate != srcRate || FConverter.DestinationRate != dstRate) {
				FConverter = new R8BrainSampleRateConverter(srcRate, dstRate, 4096, reqTransBand, R8BrainResamplerResolution.R8Brain24);
				FPullBuffer = new ResamplerPullBuffer(FConverter);
				FPullBuffer.Input = InputSignal.Value;
			}
		}