Class Audio


  • public class Audio
    extends java.lang.Object
    Audio is a container of an audio in DJL. The raw data of the audio is wrapped in a float array.
    • Constructor Summary

      Constructors 
      Constructor Description
      Audio​(float[] data)
      Constructs a new Audio instance.
      Audio​(float[] data, float sampleRate, int channels)
      Constructs a new Audio instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getChannels()
      Returns the number of channels of an audio file.
      float[] getData()
      Returns the float array data.
      float getSampleRate()
      Returns the sample rate.
      • Methods inherited from class java.lang.Object

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

      • Audio

        public Audio​(float[] data)
        Constructs a new Audio instance.
        Parameters:
        data - the wrapped float array data
      • Audio

        public Audio​(float[] data,
                     float sampleRate,
                     int channels)
        Constructs a new Audio instance.
        Parameters:
        data - the wrapped float array data
        sampleRate - the sample rate
        channels - number of channels
    • Method Detail

      • getData

        public float[] getData()
        Returns the float array data.
        Returns:
        The float array data.
      • getSampleRate

        public float getSampleRate()
        Returns the sample rate.
        Returns:
        sample rate.
      • getChannels

        public int getChannels()
        Returns the number of channels of an audio file.
        Returns:
        the number of channels of an audio file