Record Class FloatAudioFormat

java.lang.Object
java.lang.Record
net.raphimc.audiomixer.util.FloatAudioFormat

public record FloatAudioFormat(float sampleRate, int channels) extends Record
  • Constructor Details

    • FloatAudioFormat

      public FloatAudioFormat(float sampleRate, int channels)
      Creates an instance of a FloatAudioFormat record class.
      Parameters:
      sampleRate - the value for the sampleRate record component
      channels - the value for the channels record component
    • FloatAudioFormat

      public FloatAudioFormat(AudioFormat audioFormat)
  • Method Details

    • withSampleRate

      public FloatAudioFormat withSampleRate(float sampleRate)
    • withChannels

      public FloatAudioFormat withChannels(int channels)
    • millisToFrameCount

      public int millisToFrameCount(float millis)
    • frameCountToMillis

      public float frameCountToMillis(int frameCount)
    • millisToSampleCount

      public int millisToSampleCount(float millis)
    • sampleCountToMillis

      public float sampleCountToMillis(int sampleCount)
    • sampleCountToFrameCount

      public int sampleCountToFrameCount(int sampleCount)
    • toJavaAudioFormat

      public AudioFormat toJavaAudioFormat()
    • toJavaPcmAudioFormat

      public AudioFormat toJavaPcmAudioFormat(int sampleSizeInBits)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • sampleRate

      public float sampleRate()
      Returns the value of the sampleRate record component.
      Returns:
      the value of the sampleRate record component
    • channels

      public int channels()
      Returns the value of the channels record component.
      Returns:
      the value of the channels record component