Class Dsp

java.lang.Object
games.stendhal.common.math.Dsp

public class Dsp extends Object
Signal processing algorithms.
Author:
silvio
  • Constructor Summary

    Constructors
    Constructor
    Description
    Dsp()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    blendAudioData​(float[] result, int rOffset, float[] samples, int sOffset, int numSamples, float intensity)
     
    static float[]
    convertChannels​(float[] samples, int numFrames, int numChannels, int numRequiredChannels)
     
    static float[]
    convertSampleRate​(float[] samples, int numFrames, int numChannels, int sampleRate, int targetSampleRate)
    Convert the sample rate of a multi channel PCM signal.
    static byte[]
    convertUniformPCM​(byte[] pcmBuffer, float[] samples, int numSamples, int numBytesPerSample)
     
    static void
    mixAudioData​(float[] result, int rOffset, float[] samples, int sOffset, int numSamples, float intensity)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Dsp

      public Dsp()
  • Method Details

    • convertUniformPCM

      public static byte[] convertUniformPCM(byte[] pcmBuffer, float[] samples, int numSamples, int numBytesPerSample)
    • mixAudioData

      public static void mixAudioData(float[] result, int rOffset, float[] samples, int sOffset, int numSamples, float intensity)
    • blendAudioData

      public static void blendAudioData(float[] result, int rOffset, float[] samples, int sOffset, int numSamples, float intensity)
    • convertChannels

      public static float[] convertChannels(float[] samples, int numFrames, int numChannels, int numRequiredChannels)
    • convertSampleRate

      public static float[] convertSampleRate(float[] samples, int numFrames, int numChannels, int sampleRate, int targetSampleRate)
      Convert the sample rate of a multi channel PCM signal.
      Parameters:
      samples -
      numFrames -
      numChannels -
      sampleRate -
      targetSampleRate -
      Returns:
      converted sample rate