Interface AudioSong
-
- All Known Implementing Classes:
AcousticBrainzSong
,AmazonTrack
,AudioMetaData
,AudioSongFacade
,BeatportTrack
,CoverartSong
,DiscogsTrack
,FileSystemAudioSong
,ITunesAudioSong
,LastFMTrack
,ReadOnlyAudioSong
,ReferenceSong
,Song
,URLAudioSong
,WikidataSong
public interface AudioSong
Unifying interface for different implementations of audio song metadata. Possible implementations could be proxies for iTunes, proxies for an actual audio file or some other database. Changes are typically stored persistently, if writing is supported by the underlying implementation. Persistent storage may be delayed to allow for bulk write operations.
Implementations should throw
UnsupportedOperationException
s, if they cannot properly execute a method.- Author:
- Hendrik Schreiber
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AudioSong.CloudStatus
Cloud status (taken from iTunes AppleScript interface).static class
AudioSong.Instrumentation
General instrumentation, like "acoustic" or "electronic".static class
AudioSong.Liking
Liking.static class
AudioSong.MediaKind
Media kind of audio song.static class
AudioSong.TrackType
Track types.
-
Field Summary
Fields Modifier and Type Field Description static Set<String>
ACOUSTIC_NAMES
static Set<String>
ELECTRONIC_NAMES
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
addArtwork(AudioArtwork audioArtwork)
Adds an artwork/image to the audio song.default void
addBackCoverArtwork(File file)
Deprecated.default void
addFrontCoverArtwork(File file)
Deprecated.void
addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
Lets you add a property change listener to this song.void
addPropertyChangeListener(String property, PropertyChangeListener propertyChangeListener)
Lets you add a property change listener to this song.boolean
canWrite()
Checks whether the file corresponding to this song can in principal be written to.void
download()
Allows downloading of shared (e.g.String
getAlbum()
Get Album.String
getAlbumArtist()
Get album artist.Set<AudioId>
getAlbumIds()
Get album ids.default AudioSong.Liking
getAlbumLiking()
Is album liked.int
getAlbumRating()
Get album rating.ReplayGain
getAlbumReplayGain()
Replay gain for this album.String
getArtist()
Get artist.Set<AudioId>
getArtistIds()
Get artists ids.int
getArtworkCount()
Get artwork count.AudioArtwork[]
getArtworks()
Artwork belonging to this song.Image
getBackCoverImage()
Returns the first front cover image.Beats
getBeats()
The song's beats.String
getBeatsAlgorithm()
Method the beats were computed with.float
getBeatsPerMinute()
Beats per minute (BPM).String
getBeatsPerMinuteAlgorithm()
Returns the name of the algorithm used to determine the beats per minute (BPM).int
getBitRate()
Bit rate.AudioSong.CloudStatus
getCloudStatus()
Returns the cloud status, if available.Color
getColor()
Returns the color.String
getComments()
Get comments.String
getComposer()
Get composer(s).String
getContentRating()
Returns the content rating.String
getCustom1()
Custom field.String
getCustom2()
Custom field.String
getCustom3()
Custom field.String
getCustom4()
Custom field.String
getCustom5()
Custom field.Float
getDanceability()
Danceability.String
getDanceabilityAlgorithm()
Returns the name of the danceability algorithm.Date
getDateAdded()
Get date the song was added to the library.Date
getDateAnalyzed()
Date the song was last analyzed.Date
getDateModified()
Get date of last modification.String
getDescription()
Description/subtitle of this song.int
getDiscCount()
Assuming that this song is on a disc that is part of a disc collection, return the number of discs in this collection.int
getDiscNumber()
Get the disc number.String
getEpisode()
Get episode name.int
getEpisodeOrder()
Episode order.default Path
getFile()
File of this song, ornull
, if it cannot be found.Path
getFile(boolean refresh)
File of this track.byte[]
getFingerprint()
Acoustic fingerprint.float
getFinish()
Stop time of the song in seconds.Image
getFrontCoverImage()
Returns the first front cover image.String
getGenre()
Get genre.String
getGrouping()
Get grouping.Long
getId()
Persistent id.Image
getImage()
First artwork image.Image[]
getImages()
All images.<T> T
getImplementation(Class<T> klass)
AudioSong
objects are sometimes implemented by an object that acts as a facade to other AudioSong objects.List<AudioSong>
getImplementations()
Returns implementations of this interface instance.default AudioSong.Instrumentation
getInstrumentation()
Indicates whether this song qualifies as "electronic" or "acoustic".String
getInstrumentationAlgorithm()
Returns the name of the instrumentation algorithm.default AudioSong.Instrumentation
getInstrumentationBasedOnGenreAndTags()
Key
getKey()
Return the tonal key of this song.String
getKeyAlgorithm()
Returns the name of the key algorithm.String
getKind()
Kind of audio, e.g.String
getLanguage()
The language of the lyrics as ISO 639 three letter codes.default AudioSong.Liking
getLiking()
Liking.default String
getLocation()
Location of this track in the form of a url-encoded URL.String
getLocation(boolean refresh)
Location of this track.Loudness
getLoudness()
The song's loudness curve.String
getLyrics()
Returns the lyrics.List<TermFrequency>
getLyricsTermFrequencies()
Terms in this song's lyrics along with their frequency.float
getMeasuresPerMinute()
Measures (bars) per minute.AudioSong.MediaKind
getMediaKind()
Media kind of this object.Mood
getMood()
The song's mood.String
getMoodAlgorithm()
The method the associated mood value was created with.Set<String>
getMoodKeywords()
Get raw mood keywords.String
getMovement()
Classical movement.int
getMovementCount()
Classical movement count.int
getMovementNumber()
Classical movement number.String
getName()
Name of this song.String
getPath()
Path.int
getPlayCount()
Get the number of times the song was played.long
getPlayDate()
Get time the song was last played.Date
getPlayDateUTC()
Get play date.double
getPlayFrequency()
Number of times played per 100 days.double
getPlaySkipRatio()
Play/Skip ratio.default float
getPopularity()
Popularity as a value between 0 and 1.PropertyChangeListener[]
getPropertyChangeListeners()
PropertyChangeListener[]
getPropertyChangeListeners(String property)
default URL
getPurchaseURL()
URL for a website/service that allows users to purchase this song.int
getRating()
Value ranging from 0-100, 100 being best.Float
getRelativeSpectralEntropyMean()
Average of relative entropy values computed for windows of length 1.486s with a hopsize of half a window.Date
getReleaseDate()
Release year (corresponds to id3 TDRL).default float
getRemoteDisliked()
Indicates, what percentage of people "dislike" this song.default float
getRemoteLoved()
Indicates, what percentage of people "love" this song.default float
getRemotePlayFrequency()
Average of play frequencies as reported by users.default float
getRemotePlaySkipRatio()
Play/skip ratio by all users with this song.default int
getRemoteRating()
Average of other people's ratings.default Date
getRemoteUpdateDate()
Time the remote properties of this song were last updated.Float
getRMSMean()
Root mean square (RMS) of the signal's energy, averaged over windows of length ~23ms (actually 1024/44100 frames for a signal with sample rate 44.1kHz, i.e.Float
getRMSStandardDeviation()
Standard deviation of the root mean square energy values for windows of length ~23ms (actually 1024/44100 frames for a signal with sample rate 44.1kHz) with a hopsize of half a window.int
getSampleRate()
Get sample rate in Hz.int
getSeason()
Get season number.Segments
getSegments()
The song's segments.String
getSegmentsAlgorithm()
Method the segments were computed with.String
getShow()
Name of a show, suitable for TV shows.Similarities
getSimilarities()
The song's similarities.String
getSimilaritiesAlgorithm()
Method the similarities were computed with.long
getSize()
File size.int
getSkipCount()
Get skip count.Date
getSkipDate()
Get skip date.String
getSortAlbum()
Returns the "sort album".String
getSortAlbumArtist()
Returns the "sort album artist".String
getSortArtist()
Returns the "sort artist".String
getSortComposer()
Returns the sort composer.String
getSortName()
Returns the "sort name".String
getSortShow()
Returns the sort show.Float
getSpectralCentroidMean()
Average of the spectral centroids computed for individual windows of length ~23.22ms with a hopsize of half a window length.Float
getSpectralFluctuationPeak()
Peak of the averaged spectral fluctuation values computed for windows of length 23.22ms, with a hopsize of half a window.Float
getSpectralFluxMean()
Average of the spectral flux values computed for windows of length 23.22ms, with a hopsize of half a window.Float
getSpectralNoveltyMean()
Average of the spectral novelty values computed for windows of length 23.22ms, with a hopsize of half a window.Float
getSpectralSpreadMean()
Average of the spectral spread values computed for windows of length 23.22ms, with a hopsize of half a window.Float
getSpectralVariabilityMean()
Average of the spectral variability values computed for windows of length 23.22ms, with a hopsize of half a window.com.tagtraum.audiokern.timbre.BarkSpectrum
getSpectrum()
Returns the bark spectrum.float
getStart()
Start time of the song in seconds.int
getStartTime()
Start time of the song in ms.int
getStopTime()
Stop time of the song in ms.default Key
getSyncTempoKey(com.tagtraum.audiokern.bpm.Tempo syncTempo)
Returns the key this song would sound like, if the tempo was adjusted to the givensyncTempo
without key lock.default Integer
getSyncTempoTuning(com.tagtraum.audiokern.bpm.Tempo syncTempo)
Returns the tuning this song would be in, if the tempo was adjusted to the givensyncTempo
without key lock.Set<String>
getTags()
Returns a set of tags associated with this song.com.tagtraum.audiokern.bpm.Tempo
getTempo()
Returns tempo.Color
getTempoColor()
Projection ofgetTempoSpectrum()
to a color.com.tagtraum.audiokern.bpm.TempoSpectrum
getTempoSpectrum()
Returns the tempo spectrum.Color
getTempoTimbreColor()
Projection ofgetTempoSpectrum()
andgetSpectrum()
to a color.TimeSignature
getTimeSignature()
The song's time signature.String
getTimeSignatureAlgorithm()
Method the time signature was computed with.int
getTotalTime()
Total length of the song in ms.int
getTrackCount()
Number of tracks on album/release/recording.Set<AudioId>
getTrackIds()
Returns track ids.int
getTrackNumber()
Get the number of the track on the release/album/recording.ReplayGain
getTrackReplayGain()
Replay gain for this track (not taking other tracks in an album into account).default AudioSong.TrackType
getTrackType()
Track type.Integer
getTuning()
Tuning in cents.String
getTuningAlgorithm()
The method the current tuning was created with.int
getVolumeAdjustment()
Value between -255 and 255.String
getWork()
Classical work.int
getYear()
Release year - (corresponds to id3 TDRC, recording time).boolean
hasProtectedFileExtension()
Checks file endings instead of the protected flag in the iTunes Music Library.xml, since iTunes marks non-protected versions of files that used to be protected still as protected.default Boolean
isAcousticBasedOnGenreTitleAndTags()
boolean
isAlbumRatingComputed()
Indicates whether the value returned bygetAlbumRating()
was computed or set manually.boolean
isClean()
Indicates whether this song is "clean" - whatever that means.boolean
isCompilation()
Indicates whether this track is part of a compilation.boolean
isDisabled()
Indicates whether this song is disabled or unchecked.default Boolean
isElectronicBasedOnGenreAndTags()
boolean
isEnabled()
Indicates whether this song is enabled or checked.boolean
isExplicit()
Indicates whether this tracks is explicit or not.boolean
isHasVideo()
Indicates whether this track has a video.boolean
isHD()
Indicates whether this video content is in high definition (HD).boolean
isPartOfGaplessAlbum()
Indicates whether this songs is part of a gapless album.boolean
isProtected()
boolean
isPurchased()
Indicates whether this song was purchased (via the iTunes store).boolean
isRatingComputed()
Indicates whether the value returned bygetRating()
was computed or set manually.boolean
isShared()
Indicates whether this track is a shared track, i.e.boolean
isUnplayed()
Indicates whether this songs has been played at some point.default void
refreshFromFile()
Attempt to reload data from the underlying file.void
removePropertyChangeListener(PropertyChangeListener listener)
Lets you remove a property change listener to this song.void
removePropertyChangeListener(String property, PropertyChangeListener listener)
Lets you remove a property change listener to this song.void
setAlbum(String album)
Sets album name.void
setAlbumArtist(String albumArtist)
Sets the album artist.void
setAlbumLiking(AudioSong.Liking liking)
Set album liking.void
setAlbumRating(int albumRating)
Sets album rating.void
setAlbumReplayGain(ReplayGain replayGain, boolean updateITunNorm)
Sets the replay gain for this album.void
setArtist(String artist)
Sets artist.void
setArtworks(AudioArtwork... artworks)
Set artworks belonging to this track.void
setBackCoverArtwork(File... backCover)
Replace all back covers with the given files.void
setBeats(Beats beats)
Sets this song's beats.void
setBeatsAlgorithm(String beatsAlgorithm)
Sets the algorithm the beats were computed with.void
setBeatsPerMinute(float bpm)
Sets beats per minute.void
setBeatsPerMinuteAlgorithm(String bpmAlgorithm)
Sets the BPM algorithm.void
setClean(boolean clean)
Sets the "clean" flag.void
setColor(Color color)
Sets the color.void
setComments(String comments)
Set comments.void
setCompilation(boolean compilation)
Marks this song as part of a compilation (or not).void
setComposer(String composer)
Sets composer.void
setContentRating(String contentRating)
Sets the content rating.void
setCustom1(String value)
Custom field.void
setCustom2(String value)
Custom field.void
setCustom3(String value)
Custom field.void
setCustom4(String value)
Custom field.void
setCustom5(String value)
Custom field.void
setDanceability(Float danceability)
Danceability.void
setDanceabilityAlgorithm(String danceabilityAlgorithm)
Set the danceability algorithm.void
setDateAnalyzed(Date date)
Sets the date this song was last analyzed.void
setDescription(String description)
Sets description/subtitle.void
setDisabled(boolean disabled)
Enables/disables this song.void
setDiscCount(int discCount)
Set disc count.void
setDiscNumber(int discNumber)
Sets the disc number.void
setEnabled(boolean enabled)
Enables/disables this song.void
setEpisode(String episode)
Set episode name.void
setEpisodeOrder(int episodeOrder)
Set episode order.void
setExplicit(boolean explicit)
Sets the "explicit" flag.void
setFingerprint(byte[] fingerprint)
Sets the acoustic fingerprint.void
setFinish(float finish)
Sets the stop time in seconds.void
setFrontCoverArtwork(File... frontCover)
Replace all front covers with the given files.void
setGenre(String genre)
Sets genre.void
setGrouping(String grouping)
Sets the grouping.void
setHasVideo(boolean hasVideo)
Sets the "video" flag.void
setHD(boolean hd)
Sets the HD flag.void
setInstrumentation(AudioSong.Instrumentation instrumentation)
Sets the instrumentation property.void
setInstrumentationAlgorithm(String instrumentationAlgorithm)
Set the instrumentation algorithm.void
setKey(Key key)
Sets the tonal key.void
setKeyAlgorithm(String keyAlgorithm)
Set the key algorithm.void
setKind(String kind)
Allows you to store a String descriptor of the kind of audio object this is.void
setLanguage(String language)
Sets the language as ISO 639 three letter code.void
setLiking(AudioSong.Liking liking)
Set liking.void
setLocation(String location)
Sets the location.void
setLoudness(Loudness loudness)
Sets this song's loudness curve.void
setLyrics(String lyrics)
Sets lyrics.void
setMediaKind(AudioSong.MediaKind kind)
Set the kind of media, e.g.void
setMood(Mood mood)
Sets this song's mood.void
setMoodAlgorithm(String moodAlgorithm)
Sets the method the current mood value was created with.void
setMoodKeywords(Set<String> moodKeywords)
Attempt to store the raw mood keywordsvoid
setMovement(String movement)
Classical movement.void
setMovementCount(int count)
Classical movement count.void
setMovementNumber(int number)
Classical movement number.void
setName(String name)
Sets name.void
setPartOfGaplessAlbum(boolean partOfGaplessAlbum)
Sets the "gapless album" flag.void
setPlayCount(int playCount)
Set play count.void
setPlayDate(long playDate)
Set play date in milliseconds since January 1, 1970, 00:00:00 GMT (NOT related to the iTunes value!).void
setPlayDateUTC(Date playDateUTC)
Set play time.default void
setPopularity(float value)
Sets the value locally.void
setRating(int rating)
Sets the ratingvoid
setRelativeSpectralEntropyMean(Float average)
Sets the average relative spectral entropy.void
setReleaseDate(Date releaseDate)
Set release date.default void
setRemoteDisliked(float value)
Sets the value locally.default void
setRemoteLoved(float value)
Sets the value locally.default void
setRemotePlayFrequency(float value)
Sets the value locally.default void
setRemotePlaySkipRatio(float value)
Sets the value locally.default void
setRemoteRating(int value)
Sets the value locally.default void
setRemoteUpdateDate(Date date)
Sets the date that marks the last update of remote properties.void
setRMSMean(Float average)
Sets the average RMS for the first 120 seconds of this song.void
setRMSStandardDeviation(Float standardDeviation)
Sets the standard deviation of the root mean square (RMS).void
setSeason(int season)
Set season.void
setSegments(Segments segments)
Sets this song's segments.void
setSegmentsAlgorithm(String segmentsAlgorithm)
Sets the algorithm the segments were computed with.void
setShow(String show)
Set show name.void
setSimilarities(Similarities similarities)
Sets this song's similarities.void
setSimilaritiesAlgorithm(String similaritiesAlgorithm)
Sets the algorithm the similarities were computed with.void
setSkipCount(int skipCount)
Set skip count.void
setSkipDate(Date skipDate)
Set skip date.void
setSortAlbum(String sortAlbum)
Sets the sort album.void
setSortAlbumArtist(String sortAlbumArtist)
Sets the sort album artist.void
setSortArtist(String sortArtist)
Sets the sort artist.void
setSortComposer(String sortComposer)
Sets the sort composer.void
setSortName(String sortName)
Sets the sort name.void
setSortShow(String sortShow)
Sets the sort show.void
setSpectralCentroidMean(Float average)
Sets the mean of the spectral centroids.void
setSpectralFluctuationPeak(Float peak)
Peak of the spectral fluctuation values computed for windows of length 23.22ms, with a hopsize of half a window.void
setSpectralFluxMean(Float averageSpectralFlux)
Sets the mean spectral flux.void
setSpectralNoveltyMean(Float average)
Sets the average spectral novelty.void
setSpectralSpreadMean(Float average)
Sets the average spectral spread.void
setSpectralVariabilityMean(Float averageSpectralVariability)
Sets the mean spectral variability.void
setSpectrum(com.tagtraum.audiokern.timbre.BarkSpectrum spectrum)
Sets the bark spectrum.void
setStart(float start)
Sets the start time in seconds.void
setStartTime(int startTime)
Set start time in ms.void
setStopTime(int stopTime)
Sets stop time.void
setTags(Set<String> tags)
Sets a new set of tags.void
setTempo(com.tagtraum.audiokern.bpm.Tempo tempo)
Sets the tempo.void
setTempoColor(Color value)
Sets this song's tempo color.void
setTempoSpectrum(com.tagtraum.audiokern.bpm.TempoSpectrum value)
Sets the tempo spectrum.void
setTempoTimbreColor(Color value)
Sets this song's tempo-timbre color.void
setTimeSignature(TimeSignature timeSignature)
Sets this song's time signature.void
setTimeSignatureAlgorithm(String timeSignatureAlgorithm)
Sets the algorithm the time signature was computed with.void
setTrackCount(int trackCount)
Set track countvoid
setTrackNumber(int trackNumber)
Set the number of this track.void
setTrackReplayGain(ReplayGain replayGain, boolean updateITunNorm)
Sets the replay gain for this track, not taking other tracks of the album into account.void
setTrackType(AudioSong.TrackType trackType)
Field used by iTunes - typicallyAudioSong.TrackType.FILE
for files andAudioSong.TrackType.URL
for..void
setTuning(Integer tuning)
Sets tuning in cents (+-50).void
setTuningAlgorithm(String tuningAlgorithm)
Sets the tuning algorithm the current tuning value was computed with.void
setUnplayed(boolean unplayed)
Sets unplayed.void
setVolumeAdjustment(int volumeAdjustment)
Sets the volume adjustmentvoid
setWork(String work)
Classical work.void
setYear(int year)
Sets the year.
-
-
-
Method Detail
-
getImplementation
<T> T getImplementation(Class<T> klass)
AudioSong
objects are sometimes implemented by an object that acts as a facade to other AudioSong objects. This could be a proxy for an AppleScript iTunes object, a a persistent object that is stored in a local database via Hibernate, or perhaps an Object that is capable of writing id3 tags directly (e.g.AudioMetaData
). While normal calls on an object implementing this interface are routed according to some internal logic, using one of the actual implementation classes allows you precise control over what your call does.Note to plugin developers: It is hardly ever a good idea to exercise this control, unless you know exactly what you are doing. :-)
- Type Parameters:
T
- implementation class- Parameters:
klass
- class implementing AudioSong- Returns:
- object of the desired type or
null
, if such an object is not available - See Also:
PlayList.getImplementation(Class)
-
getImplementations
List<AudioSong> getImplementations()
Returns implementations of this interface instance.- Returns:
- implementations
- See Also:
getImplementation(Class)
-
addPropertyChangeListener
void addPropertyChangeListener(PropertyChangeListener propertyChangeListener) throws UnsupportedOperationException
Lets you add a property change listener to this song. This is an optional feature and may lead to exceptions.- Parameters:
propertyChangeListener
- property change listener- Throws:
UnsupportedOperationException
- if property changes notifications are not supported- See Also:
PropertyChangeSupport.addPropertyChangeListener(java.beans.PropertyChangeListener)
-
addPropertyChangeListener
void addPropertyChangeListener(String property, PropertyChangeListener propertyChangeListener) throws UnsupportedOperationException
Lets you add a property change listener to this song. This is an optional feature and may lead to exceptions.- Parameters:
property
- property namepropertyChangeListener
- property change listener- Throws:
UnsupportedOperationException
- if property changes notifications are not supported- See Also:
PropertyChangeSupport.addPropertyChangeListener(java.beans.PropertyChangeListener)
-
removePropertyChangeListener
void removePropertyChangeListener(String property, PropertyChangeListener listener)
Lets you remove a property change listener to this song. This is an optional feature and may lead to exceptions.- Parameters:
property
- property namelistener
- property change listener- Throws:
UnsupportedOperationException
- if property changes notifications are not supported- See Also:
PropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener)
-
removePropertyChangeListener
void removePropertyChangeListener(PropertyChangeListener listener)
Lets you remove a property change listener to this song. This is an optional feature and may lead to exceptions.- Parameters:
listener
- property change listener- Throws:
UnsupportedOperationException
- if property changes notifications are not supported- See Also:
PropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener)
-
getPropertyChangeListeners
PropertyChangeListener[] getPropertyChangeListeners(String property)
-
getPropertyChangeListeners
PropertyChangeListener[] getPropertyChangeListeners()
-
refreshFromFile
default void refreshFromFile() throws IOException, UnsupportedOperationException
Attempt to reload data from the underlying file.- Throws:
IOException
- if the operation failsUnsupportedOperationException
- if the operation is not supported by the current implementation- See Also:
getImplementation(Class)
-
setMediaKind
void setMediaKind(AudioSong.MediaKind kind)
Set the kind of media, e.g.AudioSong.MediaKind.AUDIOBOOK
.- Parameters:
kind
- media kind
-
getMediaKind
AudioSong.MediaKind getMediaKind()
Media kind of this object.- Returns:
- kind of media
-
isShared
boolean isShared()
Indicates whether this track is a shared track, i.e. either from another iTunes library or an iTunes Match song that hasn't been downloaded yet.- Returns:
- true or false
-
download
void download()
Allows downloading of shared (e.g. podcasts) or iCloud tracks. May not be available on Windows.
You may be notified of a change in download status of a track by registering a
PropertyChangeListener
for one of the propertiesshared
,trackType
orlocation
.- See Also:
isShared()
,getTrackType()
,getCloudStatus()
-
getCloudStatus
AudioSong.CloudStatus getCloudStatus()
Returns the cloud status, if available. Note that this call may be expensive, as it requires calling the iTunes API.- Returns:
- the status if available,
null
, if the feature is not supported (Windows, non-iTunes libraries, ...)
-
getName
String getName()
Name of this song.- Returns:
- name
-
setName
void setName(String name)
Sets name.- Parameters:
name
- name
-
getDescription
String getDescription()
Description/subtitle of this song.- Returns:
- description
-
setDescription
void setDescription(String description)
Sets description/subtitle.- Parameters:
description
- description
-
getWork
String getWork()
Classical work.- Returns:
- work
-
setWork
void setWork(String work)
Classical work.- Parameters:
work
- work
-
getMovement
String getMovement()
Classical movement.- Returns:
- movement
-
setMovement
void setMovement(String movement)
Classical movement.- Parameters:
movement
- movement
-
getMovementNumber
int getMovementNumber()
Classical movement number.- Returns:
- movement number
-
setMovementNumber
void setMovementNumber(int number)
Classical movement number.- Parameters:
number
- number
-
getMovementCount
int getMovementCount()
Classical movement count.- Returns:
- count
-
setMovementCount
void setMovementCount(int count)
Classical movement count.- Parameters:
count
- count
-
getArtist
String getArtist()
Get artist.- Returns:
- artist.
-
setArtist
void setArtist(String artist)
Sets artist.- Parameters:
artist
- artist
-
getAlbumArtist
String getAlbumArtist()
Get album artist.- Returns:
- album artist
-
setAlbumArtist
void setAlbumArtist(String albumArtist)
Sets the album artist.- Parameters:
albumArtist
- album artist
-
getComposer
String getComposer()
Get composer(s).- Returns:
- composer(s)
-
setComposer
void setComposer(String composer)
Sets composer.- Parameters:
composer
- composer
-
getAlbum
String getAlbum()
Get Album.
-
setAlbum
void setAlbum(String album)
Sets album name.- Parameters:
album
- album
-
getGrouping
String getGrouping()
Get grouping.- Returns:
- grouping
-
setGrouping
void setGrouping(String grouping)
Sets the grouping.- Parameters:
grouping
- grouping
-
getGenre
String getGenre()
Get genre.- Returns:
- genre
-
setGenre
void setGenre(String genre)
Sets genre.- Parameters:
genre
- genre
-
getKind
String getKind()
Kind of audio, e.g. "WAV audio file", "AAC audio file" or "MPEG audio file" (or localized versions thereof). This value is typically extracted fromiTunes Music Library.xml
and may simply benull
for non-iTunes libraries.- Returns:
- String describing this audio object or null if unavailable.
-
setKind
void setKind(String kind)
Allows you to store a String descriptor of the kind of audio object this is. Typically this value is read-only (withgetKind()
) and set by the music player, e.g. iTunes.- Parameters:
kind
- kind- See Also:
getKind()
-
getSize
long getSize()
File size.- Returns:
- size
-
getTotalTime
int getTotalTime()
Total length of the song in ms.- Returns:
- length in ms.
-
getTrackCount
int getTrackCount()
Number of tracks on album/release/recording.- Returns:
- track count
- See Also:
getTrackNumber()
-
setTrackCount
void setTrackCount(int trackCount)
Set track count- Parameters:
trackCount
- track count- See Also:
setTrackNumber(int)
-
getStartTime
int getStartTime()
Start time of the song in ms.- Returns:
- start time in ms.
-
setStartTime
void setStartTime(int startTime)
Set start time in ms.- Parameters:
startTime
- start time in ms
-
getStopTime
int getStopTime()
Stop time of the song in ms.- Returns:
- stop time in ms.
-
setStopTime
void setStopTime(int stopTime)
Sets stop time.- Parameters:
stopTime
- stop time in ms
-
getStart
float getStart()
Start time of the song in seconds.- Returns:
- start time in seconds.
- See Also:
getStartTime()
-
setStart
void setStart(float start)
Sets the start time in seconds.- Parameters:
start
- start time in seconds- See Also:
setStartTime(int)
-
getFinish
float getFinish()
Stop time of the song in seconds.- Returns:
- stop time in seconds.
- See Also:
getStopTime()
-
setFinish
void setFinish(float finish)
Sets the stop time in seconds.- Parameters:
finish
- stop time in seconds- See Also:
setStopTime(int)
-
getTrackNumber
int getTrackNumber()
Get the number of the track on the release/album/recording.- Returns:
- track number
-
setTrackNumber
void setTrackNumber(int trackNumber)
Set the number of this track.- Parameters:
trackNumber
- track number
-
getDiscNumber
int getDiscNumber()
Get the disc number.- Returns:
- disc number
-
setDiscNumber
void setDiscNumber(int discNumber)
Sets the disc number.- Parameters:
discNumber
- disc number
-
getDiscCount
int getDiscCount()
Assuming that this song is on a disc that is part of a disc collection, return the number of discs in this collection.- Returns:
- disc count
-
setDiscCount
void setDiscCount(int discCount)
Set disc count.- Parameters:
discCount
- disc count
-
getYear
int getYear()
Release year - (corresponds to id3 TDRC, recording time).- Returns:
- four digit recording year, if available
- See Also:
getReleaseDate()
-
setYear
void setYear(int year)
Sets the year.- Parameters:
year
- year- See Also:
getYear()
,getReleaseDate()
-
getDateModified
Date getDateModified()
Get date of last modification.- Returns:
- date
-
getDateAdded
Date getDateAdded()
Get date the song was added to the library.- Returns:
- date added
-
getDateAnalyzed
Date getDateAnalyzed()
Date the song was last analyzed.- Returns:
- date analyzed
-
setDateAnalyzed
void setDateAnalyzed(Date date)
Sets the date this song was last analyzed.- Parameters:
date
- date of last analysis
-
getBitRate
int getBitRate()
Bit rate.- Returns:
- bit rate
-
getSampleRate
int getSampleRate()
Get sample rate in Hz.- Returns:
- sample rate in Hz
-
getVolumeAdjustment
int getVolumeAdjustment()
Value between -255 and 255.- Returns:
- volume adjustment
-
setVolumeAdjustment
void setVolumeAdjustment(int volumeAdjustment)
Sets the volume adjustment- Parameters:
volumeAdjustment
- value between -255 and 255.
-
getTrackReplayGain
ReplayGain getTrackReplayGain()
Replay gain for this track (not taking other tracks in an album into account).- Returns:
- replay gain
- See Also:
- "Radio" replay gain
-
setTrackReplayGain
void setTrackReplayGain(ReplayGain replayGain, boolean updateITunNorm)
Sets the replay gain for this track, not taking other tracks of the album into account.- Parameters:
replayGain
- replay gainupdateITunNorm
- update the iTunNorm field with the given value- See Also:
getTrackReplayGain()
,getAlbumReplayGain()
-
getAlbumReplayGain
ReplayGain getAlbumReplayGain()
Replay gain for this album.- Returns:
- replay gain
- See Also:
- "Audiophile" replay gain,
getTrackReplayGain()
-
setAlbumReplayGain
void setAlbumReplayGain(ReplayGain replayGain, boolean updateITunNorm)
Sets the replay gain for this album.- Parameters:
replayGain
- replay gainupdateITunNorm
- update the iTunNorm field with the given value- See Also:
getAlbumReplayGain()
-
getComments
String getComments()
Get comments.- Returns:
- comments
-
setComments
void setComments(String comments)
Set comments.- Parameters:
comments
- comments
-
getPlayCount
int getPlayCount()
Get the number of times the song was played.- Returns:
- play count
-
setPlayCount
void setPlayCount(int playCount)
Set play count.- Parameters:
playCount
- play count
-
getPlayDate
long getPlayDate()
Get time the song was last played. Returns0
, if it has never been played.- Returns:
- play date, milliseconds since January 1, 1970, 00:00:00 GMT (NOT related to the iTunes value!)
-
setPlayDate
void setPlayDate(long playDate)
Set play date in milliseconds since January 1, 1970, 00:00:00 GMT (NOT related to the iTunes value!).- Parameters:
playDate
- play date
-
getPlayDateUTC
Date getPlayDateUTC()
Get play date.- Returns:
- play date
-
setPlayDateUTC
void setPlayDateUTC(Date playDateUTC)
Set play time.- Parameters:
playDateUTC
- play time
-
getSkipCount
int getSkipCount()
Get skip count.- Returns:
- skip count
-
setSkipCount
void setSkipCount(int skipCount)
Set skip count.- Parameters:
skipCount
- skip count
-
getSkipDate
Date getSkipDate()
Get skip date.- Returns:
- skip date
-
setSkipDate
void setSkipDate(Date skipDate)
Set skip date.- Parameters:
skipDate
- skip date
-
getReleaseDate
Date getReleaseDate()
Release year (corresponds to id3 TDRL).- Returns:
- release time
-
setReleaseDate
void setReleaseDate(Date releaseDate)
Set release date.- Parameters:
releaseDate
- release date
-
getCustom1
String getCustom1()
Custom field.- Returns:
- custom field
-
setCustom1
void setCustom1(String value)
Custom field.- Parameters:
value
- custom field value
-
getCustom2
String getCustom2()
Custom field.- Returns:
- custom field
-
setCustom2
void setCustom2(String value)
Custom field.- Parameters:
value
- custom field value
-
getCustom3
String getCustom3()
Custom field.- Returns:
- custom field
-
setCustom3
void setCustom3(String value)
Custom field.- Parameters:
value
- custom field value
-
getCustom4
String getCustom4()
Custom field.- Returns:
- custom field
-
setCustom4
void setCustom4(String value)
Custom field.- Parameters:
value
- custom field value
-
getCustom5
String getCustom5()
Custom field.- Returns:
- custom field
-
setCustom5
void setCustom5(String value)
Custom field.- Parameters:
value
- custom field value
-
getArtworkCount
int getArtworkCount()
Get artwork count.- Returns:
- artwork count
-
getImage
Image getImage()
First artwork image.- Returns:
- first artwork image of this track.
- See Also:
getFrontCoverImage()
,getBackCoverImage()
-
getImages
Image[] getImages()
All images.- Returns:
- images or empty array, never returns
null
-
getLiking
default AudioSong.Liking getLiking()
Liking. This is an expression of iTunes' loved and disliked fields.- Returns:
- a liking value
-
setLiking
void setLiking(AudioSong.Liking liking)
Set liking.- Parameters:
liking
- liking
-
getAlbumLiking
default AudioSong.Liking getAlbumLiking()
Is album liked. This is an expression of iTunes' album loved and album disliked fields.- Returns:
- liking
-
setAlbumLiking
void setAlbumLiking(AudioSong.Liking liking)
Set album liking.- Parameters:
liking
- liking
-
getRating
int getRating()
Value ranging from 0-100, 100 being best.- Returns:
- rating
- See Also:
isRatingComputed()
,getAlbumRating()
-
setRating
void setRating(int rating)
Sets the rating- Parameters:
rating
- rating between from 0 to 100- See Also:
getRating()
-
getAlbumRating
int getAlbumRating()
Get album rating.- Returns:
- album rating
- See Also:
isAlbumRatingComputed()
-
setAlbumRating
void setAlbumRating(int albumRating)
Sets album rating.- Parameters:
albumRating
- album rating
-
isRatingComputed
boolean isRatingComputed()
Indicates whether the value returned bygetRating()
was computed or set manually.- Returns:
true
orfalse
-
isAlbumRatingComputed
boolean isAlbumRatingComputed()
Indicates whether the value returned bygetAlbumRating()
was computed or set manually.- Returns:
true
orfalse
-
getShow
String getShow()
Name of a show, suitable for TV shows.- Returns:
- show name
-
setShow
void setShow(String show)
Set show name.- Parameters:
show
- show
-
getSeason
int getSeason()
Get season number. Suitable for TV-shows.- Returns:
- season.
-
setSeason
void setSeason(int season)
Set season.- Parameters:
season
- season
-
getEpisode
String getEpisode()
Get episode name.- Returns:
- episode name
-
setEpisode
void setEpisode(String episode)
Set episode name.- Parameters:
episode
- episode name
-
getEpisodeOrder
int getEpisodeOrder()
Episode order.- Returns:
- episode order
-
setEpisodeOrder
void setEpisodeOrder(int episodeOrder)
Set episode order.- Parameters:
episodeOrder
- episode order
-
isCompilation
boolean isCompilation()
Indicates whether this track is part of a compilation.
"A compilation album is an album (music or spoken-word) featuring tracks from one or more performers, often culled from a variety of sources (such as studio albums, live albums, singles, demos and outtakes.)"
-- Wikipedia Album Compliation- Returns:
true
orfalse
-
setCompilation
void setCompilation(boolean compilation)
Marks this song as part of a compilation (or not).- Parameters:
compilation
-true
orfalse
-
getId
Long getId()
Persistent id. Survives application shutdown.- Returns:
- persistent id
-
isEnabled
boolean isEnabled()
Indicates whether this song is enabled or checked.- Returns:
true
orfalse
-
setEnabled
void setEnabled(boolean enabled)
Enables/disables this song.- Parameters:
enabled
-true
orfalse
-
isDisabled
boolean isDisabled()
Indicates whether this song is disabled or unchecked.- Returns:
- !
isEnabled()
-
setDisabled
void setDisabled(boolean disabled)
Enables/disables this song.- Parameters:
disabled
-true
orfalse
-
getTrackType
default AudioSong.TrackType getTrackType()
Track type. E.g.AudioSong.TrackType.FILE
.- Returns:
- track type
- See Also:
setTrackType(TrackType)
-
setTrackType
void setTrackType(AudioSong.TrackType trackType)
Field used by iTunes - typicallyAudioSong.TrackType.FILE
for files andAudioSong.TrackType.URL
for.. well, guess what?! Typically you don't set this field manually.- Parameters:
trackType
- track type- See Also:
getTrackType()
-
isUnplayed
boolean isUnplayed()
Indicates whether this songs has been played at some point.- Returns:
true
orfalse
-
setUnplayed
void setUnplayed(boolean unplayed)
Sets unplayed.- Parameters:
unplayed
- unplayed
-
isClean
boolean isClean()
Indicates whether this song is "clean" - whatever that means. "Clean" and "explicit" are mutually exclusive.- Returns:
true
orfalse
- See Also:
isExplicit()
-
setClean
void setClean(boolean clean)
Sets the "clean" flag. "Clean" and "explicit" are mutually exclusive.- Parameters:
clean
-true
orfalse
- See Also:
setExplicit(boolean)
-
isExplicit
boolean isExplicit()
Indicates whether this tracks is explicit or not. "Clean" and "explicit" are mutually exclusive.- Returns:
true
orfalse
- See Also:
isClean()
-
setExplicit
void setExplicit(boolean explicit)
Sets the "explicit" flag. "Clean" and "explicit" are mutually exclusive.- Parameters:
explicit
-true
orfalse
- See Also:
setClean(boolean)
-
isHasVideo
boolean isHasVideo()
Indicates whether this track has a video.- Returns:
true
orfalse
-
setHasVideo
void setHasVideo(boolean hasVideo)
Sets the "video" flag.- Parameters:
hasVideo
-true
orfalse
-
isProtected
boolean isProtected()
- Returns:
true
orfalse
-
getLocation
default String getLocation()
Location of this track in the form of a url-encoded URL. The url may also contain '+' characters instead of spaces. The default implementation simply callsgetLocation(boolean)
withrefresh = false
.- Returns:
- location
-
getLocation
String getLocation(boolean refresh)
Location of this track. Ifrefresh
is true and no location is available or the resource does not exist anymore, ask the backend app (iTunes, Music.app, ...) for the correct path. Because of the backend call, this method may block and therefore should be called from the EDT.- Parameters:
refresh
- refresh from backend- Returns:
- location
- See Also:
getLocation()
,getFile(boolean)
-
setLocation
void setLocation(String location)
Sets the location.- Parameters:
location
- location
-
getPurchaseURL
default URL getPurchaseURL()
URL for a website/service that allows users to purchase this song.- Returns:
- store URL or
null
, if none is known
-
isPartOfGaplessAlbum
boolean isPartOfGaplessAlbum()
Indicates whether this songs is part of a gapless album.- Returns:
true
orfalse
-
setPartOfGaplessAlbum
void setPartOfGaplessAlbum(boolean partOfGaplessAlbum)
Sets the "gapless album" flag.- Parameters:
partOfGaplessAlbum
-true
orfalse
-
isHD
boolean isHD()
Indicates whether this video content is in high definition (HD).- Returns:
true
orfalse
-
setHD
void setHD(boolean hd)
Sets the HD flag.- Parameters:
hd
-true
orfalse
-
getSortArtist
String getSortArtist()
Returns the "sort artist". E.g., for "The Beatles" the sort artist is "Beatles".- Returns:
- sort artist
-
setSortArtist
void setSortArtist(String sortArtist)
Sets the sort artist.- Parameters:
sortArtist
- sort artist
-
getSortAlbum
String getSortAlbum()
Returns the "sort album". E.g., for "A Hard Day's Night" the sort album is "Hard Day's Night".- Returns:
- sort album
-
setSortAlbum
void setSortAlbum(String sortAlbum)
Sets the sort album.- Parameters:
sortAlbum
- sort album
-
getSortName
String getSortName()
Returns the "sort name". E.g., for "A Taste of Honey" the sort name is "Taste of Honey".- Returns:
- sort name
-
setSortName
void setSortName(String sortName)
Sets the sort name.- Parameters:
sortName
- sort name
-
getSortAlbumArtist
String getSortAlbumArtist()
Returns the "sort album artist". E.g., for "The Beatles" the sort album artist is "Beatles".- Returns:
- sort album artist
-
setSortAlbumArtist
void setSortAlbumArtist(String sortAlbumArtist)
Sets the sort album artist.- Parameters:
sortAlbumArtist
- sort album artist
-
getSortComposer
String getSortComposer()
Returns the sort composer.- Returns:
- sort composer
-
setSortComposer
void setSortComposer(String sortComposer)
Sets the sort composer.- Parameters:
sortComposer
- sort composer
-
getSortShow
String getSortShow()
Returns the sort show.- Returns:
- sort show
-
setSortShow
void setSortShow(String sortShow)
Sets the sort show.- Parameters:
sortShow
- sort show
-
getContentRating
String getContentRating()
Returns the content rating. E.g., "us-tv|TV-PG|400|" or "us-tv|TV-MA|600|dialogue and sexual content"- Returns:
- content rating
-
setContentRating
void setContentRating(String contentRating)
Sets the content rating.- Parameters:
contentRating
- content rating
-
isPurchased
boolean isPurchased()
Indicates whether this song was purchased (via the iTunes store).- Returns:
true
orfalse
-
getPlayFrequency
double getPlayFrequency()
Number of times played per 100 days.- Returns:
- played per 100 days
- See Also:
getRemotePlayFrequency()
-
getPlaySkipRatio
double getPlaySkipRatio()
Play/Skip ratio. Defined asplayCount/(skipCount+1)
.- Returns:
- playSkip ratio as defined above
- See Also:
getRemotePlaySkipRatio()
,getPopularity()
-
getFile
default Path getFile()
File of this song, ornull
, if it cannot be found. The default implementation simply callsgetFile(boolean)
withrefresh = false
.- Returns:
- file object for
getLocation()
or null, if a proper file object cannot be formed
-
getFile
Path getFile(boolean refresh)
File of this track. Ifrefresh
is true and the file does not exist anymore, ask the backend app (iTunes, Music.app, ...) for the correct file name. Because of the backend call, this method may block and therefore should be called from the EDT.- Parameters:
refresh
- refresh from backend- Returns:
- file object for
getLocation()
or null, if a proper file object cannot be formed - See Also:
getLocation()
,getLocation(boolean)
-
getPath
String getPath()
Path.- Returns:
- path object for
getLocation()
or null, if a proper file object cannot be formed
-
canWrite
boolean canWrite()
Checks whether the file corresponding to this song can in principal be written to.- Returns:
- true or false
-
hasProtectedFileExtension
boolean hasProtectedFileExtension()
Checks file endings instead of the protected flag in the iTunes Music Library.xml, since iTunes marks non-protected versions of files that used to be protected still as protected.- Returns:
- true, if we know that the file-format is usually protected.
-
getTempoColor
Color getTempoColor()
Projection ofgetTempoSpectrum()
to a color.- Returns:
- color or null
-
setTempoColor
void setTempoColor(Color value)
Sets this song's tempo color.- Parameters:
value
- color
-
getTempoTimbreColor
Color getTempoTimbreColor()
Projection ofgetTempoSpectrum()
andgetSpectrum()
to a color.- Returns:
- color or null
-
setTempoTimbreColor
void setTempoTimbreColor(Color value)
Sets this song's tempo-timbre color.- Parameters:
value
- color
-
getBeatsPerMinute
float getBeatsPerMinute()
Beats per minute (BPM).- Returns:
- beats per minute
- See Also:
getTempo()
-
setBeatsPerMinute
void setBeatsPerMinute(float bpm)
Sets beats per minute.- Parameters:
bpm
- beats per minute- See Also:
setTempo(com.tagtraum.audiokern.bpm.Tempo)
-
setTempo
void setTempo(com.tagtraum.audiokern.bpm.Tempo tempo)
Sets the tempo.- Parameters:
tempo
- tempo
-
getTempo
com.tagtraum.audiokern.bpm.Tempo getTempo()
Returns tempo.- Returns:
- tempo
-
getTags
Set<String> getTags()
Returns a set of tags associated with this song. To manipulate this song's tag, please usesetTags(java.util.Set)
and don't manipulate the returned set.- Returns:
- set of tags
-
getKey
Key getKey()
Return the tonal key of this song. E.g.,MajorKey.C_MAJOR
.- Returns:
- tonal key
-
getSyncTempoKey
default Key getSyncTempoKey(com.tagtraum.audiokern.bpm.Tempo syncTempo)
Returns the key this song would sound like, if the tempo was adjusted to the givensyncTempo
without key lock.- Parameters:
syncTempo
- sync tempo- Returns:
- sync tempo key or
null
, if at least one of key, tempo, syncTempo are unknown
-
getSyncTempoTuning
default Integer getSyncTempoTuning(com.tagtraum.audiokern.bpm.Tempo syncTempo)
Returns the tuning this song would be in, if the tempo was adjusted to the givensyncTempo
without key lock.- Parameters:
syncTempo
- sync tempo- Returns:
- sync tempo tuning in cents or
null
, if at least one of key, tempo, syncTempo are unknown - See Also:
getTuning()
-
setKey
void setKey(Key key)
Sets the tonal key.- Parameters:
key
- tonal key key- See Also:
setKeyAlgorithm(String)
-
getKeyAlgorithm
String getKeyAlgorithm()
Returns the name of the key algorithm. May beEntered
, if the key value was entered.- Returns:
- key algorithm
-
setKeyAlgorithm
void setKeyAlgorithm(String keyAlgorithm)
Set the key algorithm. Should beEntered
, if the value was entered manually.- Parameters:
keyAlgorithm
- key algorithm
-
getSpectrum
com.tagtraum.audiokern.timbre.BarkSpectrum getSpectrum()
Returns the bark spectrum.- Returns:
- bark spectrum
- See Also:
getTempoTimbreColor()
-
setSpectrum
void setSpectrum(com.tagtraum.audiokern.timbre.BarkSpectrum spectrum)
Sets the bark spectrum.- Parameters:
spectrum
- bark spectrum
-
getTempoSpectrum
com.tagtraum.audiokern.bpm.TempoSpectrum getTempoSpectrum()
Returns the tempo spectrum.- Returns:
- tempo spectrum
- See Also:
getTempoColor()
,getTempoTimbreColor()
-
setTempoSpectrum
void setTempoSpectrum(com.tagtraum.audiokern.bpm.TempoSpectrum value)
Sets the tempo spectrum.- Parameters:
value
- tempo spectrum
-
getColor
Color getColor()
Returns the color.- Returns:
- color
-
setColor
void setColor(Color color)
Sets the color.- Parameters:
color
- color
-
getBeatsPerMinuteAlgorithm
String getBeatsPerMinuteAlgorithm()
Returns the name of the algorithm used to determine the beats per minute (BPM).- Returns:
- algorithm name
-
setBeatsPerMinuteAlgorithm
void setBeatsPerMinuteAlgorithm(String bpmAlgorithm)
Sets the BPM algorithm.- Parameters:
bpmAlgorithm
- bpm algorithm name
-
getLanguage
String getLanguage()
The language of the lyrics as ISO 639 three letter codes.- Returns:
- ISO 639 three letter language code
-
setLanguage
void setLanguage(String language)
Sets the language as ISO 639 three letter code.- Parameters:
language
- ISO 639 three letter code
-
getFingerprint
byte[] getFingerprint()
Acoustic fingerprint.- Returns:
- acoustic fingerprint
-
setFingerprint
void setFingerprint(byte[] fingerprint)
Sets the acoustic fingerprint.- Parameters:
fingerprint
- fingerprint
-
setMoodKeywords
void setMoodKeywords(Set<String> moodKeywords)
Attempt to store the raw mood keywords- Parameters:
moodKeywords
- mood keywords
-
getLyrics
String getLyrics()
Returns the lyrics.- Returns:
- lyrics
-
setLyrics
void setLyrics(String lyrics)
Sets lyrics.- Parameters:
lyrics
- lyrics
-
getLyricsTermFrequencies
List<TermFrequency> getLyricsTermFrequencies()
Terms in this song's lyrics along with their frequency. All terms are lowercase, regular ASCII punctuation has been removed.- Returns:
- term frequencies
-
setTuning
void setTuning(Integer tuning)
Sets tuning in cents (+-50).- Parameters:
tuning
- in cents
-
getTuningAlgorithm
String getTuningAlgorithm()
The method the current tuning was created with.- Returns:
- tuning algorithm
-
setTuningAlgorithm
void setTuningAlgorithm(String tuningAlgorithm)
Sets the tuning algorithm the current tuning value was computed with.- Parameters:
tuningAlgorithm
- tuning algorithm
-
getMeasuresPerMinute
float getMeasuresPerMinute()
Measures (bars) per minute. This value is computed fromgetBeatsPerMinute()
andgetTimeSignature()
. In essence BPM is divided by meter (time signature) numerator.- Returns:
- measures/bars per minute or zero, if either the time signature or the BPM is not known
-
getDanceability
Float getDanceability()
Danceability.- Returns:
- normalized positive value (0-1)
-
setDanceability
void setDanceability(Float danceability)
Danceability.- Parameters:
danceability
- normalized positive value (0-1)
-
getDanceabilityAlgorithm
String getDanceabilityAlgorithm()
Returns the name of the danceability algorithm. May beEntered
, if the value was entered.- Returns:
- danceability algorithm
-
setDanceabilityAlgorithm
void setDanceabilityAlgorithm(String danceabilityAlgorithm)
Set the danceability algorithm. Should beEntered
, if the value was entered manually.- Parameters:
danceabilityAlgorithm
- danceability algorithm
-
getInstrumentation
default AudioSong.Instrumentation getInstrumentation()
Indicates whether this song qualifies as "electronic" or "acoustic".- Returns:
- instrumentation
-
getInstrumentationBasedOnGenreAndTags
default AudioSong.Instrumentation getInstrumentationBasedOnGenreAndTags()
-
isElectronicBasedOnGenreAndTags
default Boolean isElectronicBasedOnGenreAndTags()
-
isAcousticBasedOnGenreTitleAndTags
default Boolean isAcousticBasedOnGenreTitleAndTags()
-
setInstrumentation
void setInstrumentation(AudioSong.Instrumentation instrumentation)
Sets the instrumentation property.- Parameters:
instrumentation
- instrumentation
-
getInstrumentationAlgorithm
String getInstrumentationAlgorithm()
Returns the name of the instrumentation algorithm. May beEntered
, if the value was entered.- Returns:
- instrumentation algorithm
-
setInstrumentationAlgorithm
void setInstrumentationAlgorithm(String instrumentationAlgorithm)
Set the instrumentation algorithm. Should beEntered
, if the value was entered manually.- Parameters:
instrumentationAlgorithm
- instrumentation algorithm
-
setMood
void setMood(Mood mood)
Sets this song's mood.- Parameters:
mood
- mood
-
getMood
Mood getMood()
The song's mood.- Returns:
- mood
-
getMoodAlgorithm
String getMoodAlgorithm()
The method the associated mood value was created with.- Returns:
- mood algorithm
-
setMoodAlgorithm
void setMoodAlgorithm(String moodAlgorithm)
Sets the method the current mood value was created with.- Parameters:
moodAlgorithm
- mood algorithm
-
setTimeSignature
void setTimeSignature(TimeSignature timeSignature)
Sets this song's time signature.- Parameters:
timeSignature
- time signature
-
getTimeSignature
TimeSignature getTimeSignature()
The song's time signature.- Returns:
- time signature
-
getTimeSignatureAlgorithm
String getTimeSignatureAlgorithm()
Method the time signature was computed with.- Returns:
- algorithm the time signature was computed with
-
setTimeSignatureAlgorithm
void setTimeSignatureAlgorithm(String timeSignatureAlgorithm)
Sets the algorithm the time signature was computed with.- Parameters:
timeSignatureAlgorithm
- time signature algorithm
-
setBeats
void setBeats(Beats beats)
Sets this song's beats.- Parameters:
beats
- beats
-
getBeats
Beats getBeats()
The song's beats.- Returns:
- beats
-
getBeatsAlgorithm
String getBeatsAlgorithm()
Method the beats were computed with.- Returns:
- algorithm the beats were computed with
-
setBeatsAlgorithm
void setBeatsAlgorithm(String beatsAlgorithm)
Sets the algorithm the beats were computed with.- Parameters:
beatsAlgorithm
- beats algorithm
-
setSegments
void setSegments(Segments segments)
Sets this song's segments.- Parameters:
segments
- segments
-
getSegments
Segments getSegments()
The song's segments.- Returns:
- segments
-
getSegmentsAlgorithm
String getSegmentsAlgorithm()
Method the segments were computed with.- Returns:
- algorithm the segments were computed with
-
setSegmentsAlgorithm
void setSegmentsAlgorithm(String segmentsAlgorithm)
Sets the algorithm the segments were computed with.- Parameters:
segmentsAlgorithm
- segments algorithm
-
setSimilarities
void setSimilarities(Similarities similarities)
Sets this song's similarities.- Parameters:
similarities
- similarities
-
getSimilarities
Similarities getSimilarities()
The song's similarities.- Returns:
- similarities
-
getSimilaritiesAlgorithm
String getSimilaritiesAlgorithm()
Method the similarities were computed with.- Returns:
- algorithm the similarities were computed with
-
setSimilaritiesAlgorithm
void setSimilaritiesAlgorithm(String similaritiesAlgorithm)
Sets the algorithm the similarities were computed with.- Parameters:
similaritiesAlgorithm
- similarities algorithm
-
setLoudness
void setLoudness(Loudness loudness)
Sets this song's loudness curve.
-
getLoudness
Loudness getLoudness()
The song's loudness curve.- Returns:
- loudness
-
setRemoteUpdateDate
default void setRemoteUpdateDate(Date date)
Sets the date that marks the last update of remote properties. This method is usually called by the app, not the user or any user/plugin code.- Parameters:
date
- date- See Also:
getRemoteUpdateDate()
-
getRemoteUpdateDate
default Date getRemoteUpdateDate()
Time the remote properties of this song were last updated. Remote are e.g.getRemotePlayFrequency()
orgetPopularity()
.- Returns:
- date or
null
, if never
-
getRemoteRating
default int getRemoteRating()
Average of other people's ratings.- Returns:
- mean of ratings
-
setRemoteRating
default void setRemoteRating(int value)
Sets the value locally. In other words, the value is not propagated to the central database.- Parameters:
value
- value
-
getPopularity
default float getPopularity()
Popularity as a value between 0 and 1.- Returns:
- popularity among all users
-
setPopularity
default void setPopularity(float value)
Sets the value locally. In other words, the value is not propagated to the central database.- Parameters:
value
- value
-
getRemotePlayFrequency
default float getRemotePlayFrequency()
Average of play frequencies as reported by users.- Returns:
- play frequency
- See Also:
getPlayFrequency()
-
setRemotePlayFrequency
default void setRemotePlayFrequency(float value)
Sets the value locally. In other words, the value is not propagated to the central database.- Parameters:
value
- value
-
getRemotePlaySkipRatio
default float getRemotePlaySkipRatio()
Play/skip ratio by all users with this song.- Returns:
- play/skip ratio
- See Also:
getPlaySkipRatio()
-
setRemotePlaySkipRatio
default void setRemotePlaySkipRatio(float value)
Sets the value locally. In other words, the value is not propagated to the central database.- Parameters:
value
- value
-
getRemoteLoved
default float getRemoteLoved()
Indicates, what percentage of people "love" this song. May be much lower than expected.- Returns:
- value between 0 and 1.
- See Also:
getRemoteDisliked()
,getLiking()
-
setRemoteLoved
default void setRemoteLoved(float value)
Sets the value locally. In other words, the value is not propagated to the central database.- Parameters:
value
- value
-
getRemoteDisliked
default float getRemoteDisliked()
Indicates, what percentage of people "dislike" this song. May be much lower than expected.- Returns:
- value between 0 and 1.
- See Also:
getRemoteLoved()
,getLiking()
-
setRemoteDisliked
default void setRemoteDisliked(float value)
Sets the value locally. In other words, the value is not propagated to the central database.- Parameters:
value
- value
-
getRMSMean
Float getRMSMean()
Root mean square (RMS) of the signal's energy, averaged over windows of length ~23ms (actually 1024/44100 frames for a signal with sample rate 44.1kHz, i.e. 23.22ms) with a hopsize of half a window. Only the first 120 seconds of the audio are considered, the rest is discarded.- Returns:
- average RMS for the first 120 seconds
- See Also:
TemporalFeaturePipelines.createAverageRootMeanSquarePipeline(String, int, int)
,Floats.rootMeanSquare(float[])
,getRMSStandardDeviation()
-
setRMSMean
void setRMSMean(Float average)
Sets the average RMS for the first 120 seconds of this song.- Parameters:
average
- averaged RMS- See Also:
getRMSMean()
-
getRMSStandardDeviation
Float getRMSStandardDeviation()
Standard deviation of the root mean square energy values for windows of length ~23ms (actually 1024/44100 frames for a signal with sample rate 44.1kHz) with a hopsize of half a window. Only the first 120 seconds of the audio are considered, the rest is discarded.- Returns:
- standard deviation of the RMS for the first 120 seconds
- See Also:
Floats.rootMeanSquare(float[])
,getRMSMean()
-
setRMSStandardDeviation
void setRMSStandardDeviation(Float standardDeviation)
Sets the standard deviation of the root mean square (RMS).- Parameters:
standardDeviation
- standard deviation of the RMS/window
-
getSpectralCentroidMean
Float getSpectralCentroidMean()
Average of the spectral centroids computed for individual windows of length ~23.22ms with a hopsize of half a window length. Only the first 120 seconds of the signal are considered, the rest is discarded.- Returns:
- averaged spectral centroid
- See Also:
SpectralFeaturePipelines.createAverageSpectralCentroidPipeline(String, int, int, int)
-
setSpectralCentroidMean
void setSpectralCentroidMean(Float average)
Sets the mean of the spectral centroids.- Parameters:
average
- averaged spectral centroids- See Also:
getSpectralCentroidMean()
-
getSpectralSpreadMean
Float getSpectralSpreadMean()
Average of the spectral spread values computed for windows of length 23.22ms, with a hopsize of half a window. Only the first 120 seconds of the signal are considered, the rest is discarded.- Returns:
- average spectral spread
- See Also:
SpectralFeaturePipelines.createAverageSpectralSpreadPipeline(String, int, int, int)
-
setSpectralSpreadMean
void setSpectralSpreadMean(Float average)
Sets the average spectral spread.- Parameters:
average
- average spectral spread- See Also:
getSpectralSpreadMean()
-
getRelativeSpectralEntropyMean
Float getRelativeSpectralEntropyMean()
Average of relative entropy values computed for windows of length 1.486s with a hopsize of half a window. Only the first 120 seconds of the signal are considered, the rest is discarded.- Returns:
- average relative entropy
- See Also:
AggregateFunctions.RELATIVE_ENTROPY
,SpectralFeaturePipelines.createAverageRelativeSpectralEntropyPipeline(String, int, int, int)
-
setRelativeSpectralEntropyMean
void setRelativeSpectralEntropyMean(Float average)
Sets the average relative spectral entropy.- Parameters:
average
- average- See Also:
getRelativeSpectralEntropyMean()
-
setSpectralNoveltyMean
void setSpectralNoveltyMean(Float average)
Sets the average spectral novelty.- Parameters:
average
- average- See Also:
getSpectralNoveltyMean()
-
getSpectralNoveltyMean
Float getSpectralNoveltyMean()
Average of the spectral novelty values computed for windows of length 23.22ms, with a hopsize of half a window. Only the first 120 seconds of the signal are considered, the rest is discarded.- Returns:
- average spectral novelty
-
setSpectralFluctuationPeak
void setSpectralFluctuationPeak(Float peak)
Peak of the spectral fluctuation values computed for windows of length 23.22ms, with a hopsize of half a window. Only the first 120 seconds of the signal are considered, the rest is discarded.- Parameters:
peak
- peak in an averaged fluctuation spectrum- See Also:
getSpectralFluctuationPeak()
-
getSpectralFluctuationPeak
Float getSpectralFluctuationPeak()
Peak of the averaged spectral fluctuation values computed for windows of length 23.22ms, with a hopsize of half a window. Only the first 120 seconds of the signal are considered, the rest is discarded.- Returns:
- peak of an averaged fluctuation spectrum
- See Also:
SpectralFeaturePipelines.createAverageSpectralFluctuationPipeline(String, int)
-
getSpectralFluxMean
Float getSpectralFluxMean()
Average of the spectral flux values computed for windows of length 23.22ms, with a hopsize of half a window. Only the first 120 seconds of the signal are considered, the rest is discarded.- Returns:
- average spectral flux
- See Also:
SpectralFeaturePipelines.createAverageSpectralFluxPipeline(String, int, int, int)
-
setSpectralFluxMean
void setSpectralFluxMean(Float averageSpectralFlux)
Sets the mean spectral flux.- Parameters:
averageSpectralFlux
- average spectral flux- See Also:
getSpectralFluxMean()
-
getSpectralVariabilityMean
Float getSpectralVariabilityMean()
Average of the spectral variability values computed for windows of length 23.22ms, with a hopsize of half a window. Only the first 120 seconds of the signal are considered, the rest is discarded.- Returns:
- average spectral variability
- See Also:
SpectralFeaturePipelines.createAverageSpectralVariabilityPipeline(String, int, int, int)
-
setSpectralVariabilityMean
void setSpectralVariabilityMean(Float averageSpectralVariability)
Sets the mean spectral variability.- Parameters:
averageSpectralVariability
- average spectral variability- See Also:
getSpectralVariabilityMean()
-
addBackCoverArtwork
@Deprecated default void addBackCoverArtwork(File file)
Deprecated.Add a back cover image file to audio song.- Parameters:
file
- back cover file- See Also:
addFrontCoverArtwork(java.io.File)
,addArtwork(AudioArtwork)
-
addFrontCoverArtwork
@Deprecated default void addFrontCoverArtwork(File file)
Deprecated.Add a front cover image file to audio song.- Parameters:
file
- front cover file- See Also:
addBackCoverArtwork(java.io.File)
,addArtwork(AudioArtwork)
-
addArtwork
void addArtwork(AudioArtwork audioArtwork)
Adds an artwork/image to the audio song.- Parameters:
audioArtwork
- artwork
-
setFrontCoverArtwork
void setFrontCoverArtwork(File... frontCover)
Replace all front covers with the given files.- Parameters:
frontCover
- front cover- See Also:
setBackCoverArtwork(java.io.File...)
-
setBackCoverArtwork
void setBackCoverArtwork(File... backCover)
Replace all back covers with the given files.- Parameters:
backCover
- back cover- See Also:
setFrontCoverArtwork(java.io.File...)
-
getFrontCoverImage
Image getFrontCoverImage()
Returns the first front cover image.- Returns:
- image or null
-
getBackCoverImage
Image getBackCoverImage()
Returns the first front cover image.- Returns:
- image or null
-
getArtworks
AudioArtwork[] getArtworks()
Artwork belonging to this song.- Returns:
- array of artworks
-
setArtworks
void setArtworks(AudioArtwork... artworks)
Set artworks belonging to this track.- Parameters:
artworks
- artworks
-
-