AudioSection

data class AudioSection(start: Float, duration: Float, confidence: Float, loudness: Float, tempo: Float?, tempoConfidence: Float?, key: Int, keyConfidence: Float?, mode: Int?, modeConfidence: Float?, timeSignature: Int, timeSignatureConfidence: Float)

Sections are defined by large variations in rhythm or timbre, e.g. chorus, verse, bridge, guitar solo, etc. Each section contains its own descriptions of tempo, key, mode, time_signature, and loudness.*

Parameters

start

The starting point (in seconds) of the section.

duration

The duration (in seconds) of the section.

confidence

The confidence, from 0.0 to 1.0, of the reliability of the section’s “designation”.

loudness

The overall loudness of the section in decibels (dB). Loudness values are useful for comparing relative loudness of sections within tracks.

tempo

The overall estimated tempo of the section in beats per minute (BPM). In musical terminology, tempo is the speed or pace of a given piece and derives directly from the average beat duration.

tempoConfidence

The confidence, from 0.0 to 1.0, of the reliability of the tempo. Some tracks contain tempo changes or sounds which don’t contain tempo (like pure speech) which would correspond to a low value in this field.

key

The estimated overall key of the section. The values in this field ranging from 0 to 11 mapping to pitches using standard Pitch Class notation (E.g. 0 = C, 1 = C♯/D♭, 2 = D, and so on). If no key was detected, the value is -1.

keyConfidence

The confidence, from 0.0 to 1.0, of the reliability of the key. Songs with many key changes may correspond to low values in this field.

mode

Indicates the modality (major or minor) of a track, the type of scale from which its melodic content is derived. This field will contain a 0 for “minor”, a 1 for “major”, or a -1 for no result. Note that the major key (e.g. C major) could more likely be confused with the minor key at 3 semitones lower (e.g. A minor) as both keys carry the same pitches.

modeConfidence

The confidence, from 0.0 to 1.0, of the reliability of the mode.

timeSignature

An estimated overall time signature of a track. The time signature (meter) is a notational convention to specify how many beats are in each bar (or measure). The time signature ranges from 3 to 7 indicating time signatures of “3/4”, to “7/4”.

timeSignatureConfidence

The confidence, from 0.0 to 1.0, of the reliability of the time_signature. Sections with time signature changes may correspond to low values in this field.

Constructors

AudioSection
Link copied to clipboard
common
fun AudioSection(start: Float = 0f, duration: Float, confidence: Float, loudness: Float, tempo: Float? = null, tempoConfidence: Float? = null, key: Int, keyConfidence: Float? = null, mode: Int? = null, modeConfidence: Float? = null, timeSignature: Int, timeSignatureConfidence: Float)
The starting point (in seconds) of the section.

Functions

component1
Link copied to clipboard
common
operator fun component1(): Float
component10
Link copied to clipboard
common
operator fun component10(): Float?
component11
Link copied to clipboard
common
operator fun component11(): Int
component12
Link copied to clipboard
common
operator fun component12(): Float
component2
Link copied to clipboard
common
operator fun component2(): Float
component3
Link copied to clipboard
common
operator fun component3(): Float
component4
Link copied to clipboard
common
operator fun component4(): Float
component5
Link copied to clipboard
common
operator fun component5(): Float?
component6
Link copied to clipboard
common
operator fun component6(): Float?
component7
Link copied to clipboard
common
operator fun component7(): Int
component8
Link copied to clipboard
common
operator fun component8(): Float?
component9
Link copied to clipboard
common
operator fun component9(): Int?
copy
Link copied to clipboard
common
fun copy(start: Float = 0f, duration: Float, confidence: Float, loudness: Float, tempo: Float? = null, tempoConfidence: Float? = null, key: Int, keyConfidence: Float? = null, mode: Int? = null, modeConfidence: Float? = null, timeSignature: Int, timeSignatureConfidence: Float): AudioSection
equals
Link copied to clipboard
common
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open override fun hashCode(): Int
toString
Link copied to clipboard
common
open override fun toString(): String

Properties

confidence
Link copied to clipboard
common
val confidence: Float
The confidence, from 0.0 to 1.0, of the reliability of the section’s “designation”.
duration
Link copied to clipboard
common
val duration: Float
The duration (in seconds) of the section.
key
Link copied to clipboard
common
val key: Int
The estimated overall key of the section.
keyConfidence
Link copied to clipboard
common
val keyConfidence: Float? = null
The confidence, from 0.0 to 1.0, of the reliability of the key.
loudness
Link copied to clipboard
common
val loudness: Float
The overall loudness of the section in decibels (dB).
mode
Link copied to clipboard
common
val mode: Int? = null
Indicates the modality (major or minor) of a track, the type of scale from which its melodic content is derived.
modeConfidence
Link copied to clipboard
common
val modeConfidence: Float? = null
The confidence, from 0.0 to 1.0, of the reliability of the mode.
start
Link copied to clipboard
common
val start: Float = 0f
The starting point (in seconds) of the section.
tempo
Link copied to clipboard
common
val tempo: Float? = null
The overall estimated tempo of the section in beats per minute (BPM).
tempoConfidence
Link copied to clipboard
common
val tempoConfidence: Float? = null
The confidence, from 0.0 to 1.0, of the reliability of the tempo.
timeSignature
Link copied to clipboard
common
val timeSignature: Int
An estimated overall time signature of a track.
timeSignatureConfidence
Link copied to clipboard
common
val timeSignatureConfidence: Float
The confidence, from 0.0 to 1.0, of the reliability of the time_signature.

Sources

(source)
Link copied to clipboard