Record Class AudioBuffer
java.lang.Object
java.lang.Record
net.raphimc.audiomixer.util.buffer.AudioBuffer
-
Constructor Summary
ConstructorsConstructorDescriptionAudioBuffer(FloatAudioFormat format, float[] samples) Creates an instance of aAudioBufferrecord class.AudioBuffer(FloatAudioFormat format, int frameCount) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(AudioBuffer other) append(AudioBuffer other) voidclear()copy()final booleanIndicates whether some other object is "equal to" this one.format()Returns the value of theformatrecord component.intfloatintfinal inthashCode()Returns a hash code value for this object.voidvoidmultiply(float factor) voidfloatfloat[]samples()Returns the value of thesamplesrecord component.slice(int from, int to) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AudioBuffer
Creates an instance of aAudioBufferrecord class.- Parameters:
format- the value for theformatrecord componentsamples- the value for thesamplesrecord component
-
AudioBuffer
-
-
Method Details
-
add
-
multiply
public void multiply(float factor) -
limitToUnitRange
public void limitToUnitRange() -
normalizePeak
public void normalizePeak() -
clear
public void clear() -
copy
-
createWorkBuffer
-
peakAmplitude
public float peakAmplitude() -
getSampleCount
public int getSampleCount() -
getFrameCount
public int getFrameCount() -
getMillisecondLength
public float getMillisecondLength() -
append
-
slice
-
trimLeadingSilence
-
trimTrailingSilence
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
format
Returns the value of theformatrecord component.- Returns:
- the value of the
formatrecord component
-
samples
public float[] samples()Returns the value of thesamplesrecord component.- Returns:
- the value of the
samplesrecord component
-