from datetime import timedelta
from .object import SpotifyObject
Represents an Audio Features object.
The Spotify ID of the track.
Spotify URI of the album.
An HTTP URL to access the full audio analysis of this track.
A link to the Web API endpoint providing full details of the track.
The duration of the track.
The estimated overall key of the track.
Mode indicates the modality (major or minor) of a track, the type of scale from which its melodic content is derived.
An estimated overall time signature of a track.
A confidence measure from 0.0 to 1.0 of whether the track is acoustic.
A measure of how suitable the track is for dancing.
Energy is a measure from 0.0 to 1.0 and represents a perceptual measure of intensity and activity.
Predicts whether a track contains no vocals.
Detects the presence of an audience in the recording.
The overall loudness of a track in decibels (dB).
Speechiness detects the presence of spoken words in a track.
A measure from 0.0 to 1.0 describing the musical positiveness conveyed by a track.
The overall estimated tempo of a track in beats per minute (BPM).
_type = 'audio_features'
def __init__(self, client, data):
self.acousticness = data.pop('acousticness')
self.analysis_url = data.pop('analysis_url')
self.danceability = data.pop('danceability')
self.duration = timedelta(milliseconds=data.pop('duration_ms'))
self.energy = data.pop('energy')
self.instrumentalness = data.pop('instrumentalness')
self.key = data.pop('key')
self.liveness = data.pop('liveness')
self.loudness = data.pop('loudness')
self.mode = data.pop('mode')
self.speechiness = data.pop('speechiness')
self.tempo = data.pop('tempo')
self.time_signature = data.pop('time_signature')
self.track_href = data.pop('track_href')
self.valence = data.pop('valence')