Class AudioAnalysisTrack

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

public class AudioAnalysisTrack extends AbstractModelObject
Retrieve information about Audio Analysis Track objects by creating instances from this class.
See Also:
  • Method Details

    • getNumSamples

      public Long getNumSamples()
      Get the number of samples in the track.
      The total number of samples is calculated by multiplying the duration of the track with the sample rate.
      Returns:
      The total number of samples in the track.
    • getDuration

      public Float getDuration()
      Get the duration of the track in seconds.
      Returns:
      The duration of the track in seconds.
    • getSampleMd5

      public String getSampleMd5()
      Get the sample MD5.

      Note: The sample MD5 is probably the MD5 of the track file. In the documentation of the Analyzer software, this field is mentioned in an example and contains a value, but it seems that audio analysis objects returned by the Spotify Web API doesn't include a value in the field anymore.

      Returns:
      The sample MD5.
    • getOffsetSeconds

      public Integer getOffsetSeconds()
      Get the offset seconds.
      Note: There is no public documentation available for this field.
      Returns:
      The offset seconds.
    • getWindowSeconds

      public Integer getWindowSeconds()
      Get the window seconds.
      Note: There is no public documentation available for this field.
      Returns:
      The window seconds.
    • getAnalysisSampleRate

      public Long getAnalysisSampleRate()
      Get the sample rate in which the audio analysis was performed.
      Returns:
      The analysis sample rate.
    • getAnalysisChannels

      public Integer getAnalysisChannels()
      Get the analysis channels.
      Returns:
      The analysis channels.
    • getEndOfFadeIn

      public Float getEndOfFadeIn()
      Get the end of fade in introduction of the track.
      Returns:
      The end of fade in introduction in seconds.
    • getStartOfFadeOut

      public Float getStartOfFadeOut()
      Get the start of the fade out in seconds.
      Returns:
      The start of the fade out in seconds.
    • getLoudness

      public Float getLoudness()
      Get the average loudness of the track in decibels. These values are mostly in a range between -60 and 0 decibels.
      Returns:
      Average loudness of the track.
    • getTempo

      public Float getTempo()
      Get the estimated tempo of the track in beats per minute.
      Returns:
      The estimated tempo of the track.
    • getTempoConfidence

      public Float getTempoConfidence()
      Get the tempo confidence of the track.
      Returns:
      The tempo confidence of the track.
    • getTimeSignature

      public Integer getTimeSignature()
      Get the estimated overall time signature of the track. The time signature (or meter) is the number of beats in a bar.
      Example: A Viennese waltz has a three-quarters beat, so this method would return the value 3 in this case.
      Returns:
      Time signature value.
    • getTimeSignatureConfidence

      public Float getTimeSignatureConfidence()
      Get the time signature confidence of the track.
      Returns:
      The time signature confidence.
    • getKey

      public Integer getKey()
      Get the estimated main key of the track.
      Returns:
      Main key of the track.
      See Also:
    • getKeyConfidence

      public Float getKeyConfidence()
      Get the key confidence of the track.
      Returns:
      The key confidence of the track.
    • getMode

      public Modality getMode()
      Get the modality of the track. (either "major" or "minor")
      Returns:
      The modality type of the track.
      See Also:
    • getModeConfidence

      public Float getModeConfidence()
      Get the modality confidence of the track.
      Returns:
      The modality confidence of the track.
    • getCodeString

      public String getCodeString()
      Get the code string of the track.

      Note: The code string is a fingerprint computed on the audio and were used by the Echo Nest services for song identification, which are no longer available.

      Returns:
      The code string of the track.
    • getCodeVersion

      public Float getCodeVersion()
      Get the version of the code string.
      Returns:
      The version of the code string.
    • getEchoprintString

      public String getEchoprintString()
      Get the echoprint string of the track.

      Note: The echoprint string is a fingerprint computed on the audio and were used by the Echo Nest services for song identification, which are no longer available.

      Returns:
      The echoprint string of the track.
    • getEchoprintVersion

      public Float getEchoprintVersion()
      Get the version of the echoprint string.
      Returns:
      The version of the echoprint string.
    • getSynchString

      public String getSynchString()
      Get the synch string of the track.

      It works with a simple synchronization algorithm to be implemented on the client side, which generates offset values in numbers of samples for 3 locations in the decoded waveform, the beginning, the middle, and the end. These offsets allow the client application to detect decoding errors (when offsets mismatch). They provide for synching with sample accuracy, the JSON timing data with the waveform, regardless of which mp3 decoder was used on the client side (quicktime, ffmpeg, mpg123, etc).

      Returns:
      The synch string.
    • getSynchVersion

      public Float getSynchVersion()
      Get the version of the synch string.
      Returns:
      The synch string version.
    • getRhythmString

      public String getRhythmString()
      Get the rhythm string of the track.

      Returns:
      The rhythm string of the track.
    • getRhythmVersion

      public Float getRhythmVersion()
      Get the version of the rhythm string.
      Returns:
      The rhythm string version.
    • 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 AudioAnalysisTrack.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.