Class AudioAnalysisSegment

java.lang.Object
se.michaelthelin.spotify.model_objects.AbstractModelObject
se.michaelthelin.spotify.model_objects.miscellaneous.AudioAnalysisSegment
All Implemented Interfaces:
Serializable, IModelObject

public class AudioAnalysisSegment extends AbstractModelObject
Retrieve information about Audio Analysis Segments by creating instances from this class.
Segments are sound entities (typically under a second) each relatively uniform in timbre and harmony. They are characterized by their perceptual onsets and duration in seconds, loudness (dB), pitch and timbral content.
See Also:
  • Method Details

    • getMeasure

      public AudioAnalysisMeasure getMeasure()
      Get the measure of the audio analysis segment object. This measure contains the start point, duration and confidence of the segment.
      Returns:
      The measure of the audio analysis segment object.
    • getLoudnessStart

      public Float getLoudnessStart()
      Get the loudness level at the start of the segment.
      Returns:
      The loudness level at the start of the segment.
    • getLoudnessMaxTime

      public Float getLoudnessMaxTime()
      Get the offset within the segment of the point of maximum loudness.
      Returns:
      The offset within the segment of the point of maximum loudness.
    • getLoudnessMax

      public Float getLoudnessMax()
      Get the peak loudness value within the segment.
      Returns:
      The peak loudness value within the segment.
    • getLoudnessEnd

      public Float getLoudnessEnd()
      Get the loudness level at the end of the segment. This is only specified in the last segment of the audio analysis.
      Returns:
      The loudness level at the end of the segment.
    • getPitches

      public float[] getPitches()
      Get the pitches of the segment.

      Pitch content is given by a "chroma" vector, corresponding to the 12 pitch classes C, C#, D to B, with values ranging from 0 to 1 that describe the relative dominance of every pitch in the chromatic scale. For example a C Major chord would likely be represented by large values of C, E and G (i.e. classes 0, 4, and 7). Vectors are normalized to 1 by their strongest dimension, therefore noisy sounds are likely represented by values that are all close to 1, while pure tones are described by one value at 1 (the pitch) and others near

      Returns:
      The pitches of the segment.
    • getTimbre

      public float[] getTimbre()
      Get the timbre of the segment.

      The timbre is the quality of a musical note or sound that distinguishes different types of musical instruments, or voices. It is a complex notion also referred to as sound color, texture, or tone quality, and is derived from the shape of a segments spectro-temporal surface, independently of pitch and loudness.

      Returns:
      The timbre of the track.
    • toString

      public String toString()
      Description copied from class: AbstractModelObject
      Returns a String representation of this model object in the style:

      ModelObject(attr1=value1, attr2=value2, ...)

      Specified by:
      toString in class AbstractModelObject
    • builder

      public AudioAnalysisSegment.Builder builder()
      Description copied from interface: IModelObject
      Create a builder for building an instance of a model object.
      The type of the builder and its methods depend on its corresponding implementation.
      Returns:
      A builder object.