Package ca.phon.audio

Interface Sampled

All Known Implementing Classes:
AbstractSampled, ArraySampled, AudioFileSampled, ChannelFilteredSampled, EmptySampled, MonoSampled

public interface Sampled
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Release resources
    float
    End time in seconds
    float
    Get length in seconds
    int
    Get the number of channels.
    int
    Return the number of samples
    float
    Get sample rate.
    float
    Get start time
    double[][]
    getWindowExtrema(float startTime, float endTime)
     
    double[]
    getWindowExtrema(int channel, float startTime, float endTime)
    Get min/max values for specified time range
    void
    getWindowExtrema(int channel, float startTime, float endTime, double[] extrema)
    Get min/max values for specified time range
    double[][]
    getWindowExtrema(int firstSample, int lastSample)
     
    double[]
    getWindowExtrema(int channel, int firstSample, int lastSample)
    Get the miminum and maximum values for the specified sample range
    void
    getWindowExtrema(int channel, int firstSample, int lastSample, double[] extrema)
    Get min/max values for specified window
    int
    loadSampleData(double[][] buffer, int offset, int firstSample, int numSamples)
     
    double
    maximumValue(int channel, float startTime, float endTime)
    Get the maximum value for the specified time range
    double
    maximumValue(int channel, int firstSample, int lastSample)
    Get the maximum value for the specified sample range
    double
    minimumValue(int channel, int firstSample, int lastSample)
    Get the minimum value for the specified sample range
    int
    sampleForTime(float time)
    Convert a time value to a sample index
    double
    valueForSample(int channel, int sample)
    Get value for sample
    double
    valueForTime(int channel, float time)
    Get value for specified time
  • Method Details

    • getNumberOfChannels

      int getNumberOfChannels()
      Get the number of channels.
      Returns:
      number of channels
    • getNumberOfSamples

      int getNumberOfSamples()
      Return the number of samples
      Returns:
      number of samples
    • getSampleRate

      float getSampleRate()
      Get sample rate.
      Returns:
      sample rate (samples/second)
    • valueForSample

      double valueForSample(int channel, int sample)
      Get value for sample
      Parameters:
      channel -
      sample - index
    • sampleForTime

      int sampleForTime(float time)
      Convert a time value to a sample index
      Parameters:
      time - (in seconds)
      Returns:
      sample index or -1 if time is outside Sampled data range
    • valueForTime

      double valueForTime(int channel, float time)
      Get value for specified time
      Parameters:
      time -
      Returns:
      value at specified time
    • getStartTime

      float getStartTime()
      Get start time
      Returns:
      start time in seconds
    • getEndTime

      float getEndTime()
      End time in seconds
      Returns:
      end time in seconds
    • getLength

      float getLength()
      Get length in seconds
      Returns:
      length in seconds
    • close

      void close() throws IOException
      Release resources
      Throws:
      IOException
    • maximumValue

      double maximumValue(int channel, int firstSample, int lastSample)
      Get the maximum value for the specified sample range
      Parameters:
      channel -
      firstSample -
      lastSample -
      Returns:
      maximum value for specified range
    • maximumValue

      double maximumValue(int channel, float startTime, float endTime)
      Get the maximum value for the specified time range
      Parameters:
      channel -
      startTime -
      endTime -
      Returns:
      maximum value for specified range
    • minimumValue

      double minimumValue(int channel, int firstSample, int lastSample)
      Get the minimum value for the specified sample range
      Parameters:
      channel -
      firstSample -
      lastSample -
      Returns:
      minimum value for specified range
    • loadSampleData

      int loadSampleData(double[][] buffer, int offset, int firstSample, int numSamples)
    • getWindowExtrema

      double[][] getWindowExtrema(int firstSample, int lastSample)
    • getWindowExtrema

      double[][] getWindowExtrema(float startTime, float endTime)
    • getWindowExtrema

      double[] getWindowExtrema(int channel, int firstSample, int lastSample)
      Get the miminum and maximum values for the specified sample range
      Parameters:
      channel -
      firstSample -
      lastSample -
      Returns:
      min/max values for range
    • getWindowExtrema

      void getWindowExtrema(int channel, int firstSample, int lastSample, double[] extrema)
      Get min/max values for specified window
      Parameters:
      channel -
      firstSample -
      extrema -
      ladSample -
    • getWindowExtrema

      double[] getWindowExtrema(int channel, float startTime, float endTime)
      Get min/max values for specified time range
      Parameters:
      channel -
      startTime -
      endTime -
      Returns:
      min/max values for specified range
    • getWindowExtrema

      void getWindowExtrema(int channel, float startTime, float endTime, double[] extrema)
      Get min/max values for specified time range
      Parameters:
      channel -
      startTime -
      endTime -
      extrema - an array of double[2] where the data will be stored