Package soundPlayback

Class PBSampleRateData

java.lang.Object
soundPlayback.PBSampleRateData

public class PBSampleRateData extends Object
Single class to hold everything we need to know about sample rates. Output sample rate will be the rate that data are being played back at at the device. This will be the same as the data rate after decimation for a real time system but may be different for a non-real time system that is playing faster or slower than real time.
Author:
dg50
  • Constructor Details

    • PBSampleRateData

      public PBSampleRateData(double inputSampleRate, double outputSampleRate, double speedFactor)
      Parameters:
      inputSampleRate - Input sample rate
      outputSampleRate - Output sample rate
      speedFactor - Speed factor (how fast output will be compared to input)
    • PBSampleRateData

      public PBSampleRateData(double inputSampleRate, double outputSampleRate)
      Parameters:
      inputSampleRate - Input sample rate
      outputSampleRate - Output sample rate.
      Decimation factor will be set to inputSampleRat / outputSampleRate
  • Method Details

    • getInputSampleRate

      public double getInputSampleRate()
      Returns:
      the inputSampleRate
    • getOutputSampleRate

      public double getOutputSampleRate()
      Returns:
      the outputSampleRate
    • getSpeedFactor

      public double getSpeedFactor()
      Returns:
      the speedFactor
    • getDecimationFactor

      public double getDecimationFactor()
      Returns:
      the decimationFactor
    • toString

      public String toString()
      Overrides:
      toString in class Object