Interface AudioSong
-
- All Known Implementing Classes:
AcousticBrainzSong,AmazonTrack,AudioMetaData,AudioSongFacade,BeatportTrack,CoverartSong,DiscogsTrack,FileSystemAudioSong,ITunesAudioSong,LastFMTrack,ReadOnlyAudioSong,ReferenceSong,Song,URLAudioSong,WikidataSong
public interface AudioSongUnifying 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
UnsupportedOperationExceptions, if they cannot properly execute a method.- Author:
- Hendrik Schreiber
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAudioSong.CloudStatusCloud status (taken from iTunes AppleScript interface).static classAudioSong.InstrumentationGeneral instrumentation, like "acoustic" or "electronic".static classAudioSong.LikingLiking.static classAudioSong.MediaKindMedia kind of audio song.static classAudioSong.TrackTypeTrack types.
-
Field Summary
Fields Modifier and Type Field Description static Set<String>ACOUSTIC_NAMESstatic Set<String>ELECTRONIC_NAMES
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidaddArtwork(AudioArtwork audioArtwork)Adds an artwork/image to the audio song.default voidaddBackCoverArtwork(File file)Deprecated.default voidaddFrontCoverArtwork(File file)Deprecated.voidaddPropertyChangeListener(PropertyChangeListener propertyChangeListener)Lets you add a property change listener to this song.voidaddPropertyChangeListener(String property, PropertyChangeListener propertyChangeListener)Lets you add a property change listener to this song.booleancanWrite()Checks whether the file corresponding to this song can in principal be written to.voiddownload()Allows downloading of shared (e.g.StringgetAlbum()Get Album.StringgetAlbumArtist()Get album artist.Set<AudioId>getAlbumIds()Get album ids.default AudioSong.LikinggetAlbumLiking()Is album liked.intgetAlbumRating()Get album rating.ReplayGaingetAlbumReplayGain()Replay gain for this album.StringgetArtist()Get artist.Set<AudioId>getArtistIds()Get artists ids.intgetArtworkCount()Get artwork count.AudioArtwork[]getArtworks()Artwork belonging to this song.ImagegetBackCoverImage()Returns the first front cover image.BeatsgetBeats()The song's beats.StringgetBeatsAlgorithm()Method the beats were computed with.floatgetBeatsPerMinute()Beats per minute (BPM).StringgetBeatsPerMinuteAlgorithm()Returns the name of the algorithm used to determine the beats per minute (BPM).intgetBitRate()Bit rate.AudioSong.CloudStatusgetCloudStatus()Returns the cloud status, if available.ColorgetColor()Returns the color.StringgetComments()Get comments.StringgetComposer()Get composer(s).StringgetContentRating()Returns the content rating.StringgetCustom1()Custom field.StringgetCustom2()Custom field.StringgetCustom3()Custom field.StringgetCustom4()Custom field.StringgetCustom5()Custom field.FloatgetDanceability()Danceability.StringgetDanceabilityAlgorithm()Returns the name of the danceability algorithm.DategetDateAdded()Get date the song was added to the library.DategetDateAnalyzed()Date the song was last analyzed.DategetDateModified()Get date of last modification.StringgetDescription()Description/subtitle of this song.intgetDiscCount()Assuming that this song is on a disc that is part of a disc collection, return the number of discs in this collection.intgetDiscNumber()Get the disc number.StringgetEpisode()Get episode name.intgetEpisodeOrder()Episode order.default PathgetFile()File of this song, ornull, if it cannot be found.PathgetFile(boolean refresh)File of this track.byte[]getFingerprint()Acoustic fingerprint.floatgetFinish()Stop time of the song in seconds.ImagegetFrontCoverImage()Returns the first front cover image.StringgetGenre()Get genre.StringgetGrouping()Get grouping.LonggetId()Persistent id.ImagegetImage()First artwork image.Image[]getImages()All images.<T> TgetImplementation(Class<T> klass)AudioSongobjects 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.InstrumentationgetInstrumentation()Indicates whether this song qualifies as "electronic" or "acoustic".StringgetInstrumentationAlgorithm()Returns the name of the instrumentation algorithm.default AudioSong.InstrumentationgetInstrumentationBasedOnGenreAndTags()KeygetKey()Return the tonal key of this song.StringgetKeyAlgorithm()Returns the name of the key algorithm.StringgetKind()Kind of audio, e.g.StringgetLanguage()The language of the lyrics as ISO 639 three letter codes.default AudioSong.LikinggetLiking()Liking.default StringgetLocation()Location of this track in the form of a url-encoded URL.StringgetLocation(boolean refresh)Location of this track.LoudnessgetLoudness()The song's loudness curve.StringgetLyrics()Returns the lyrics.List<TermFrequency>getLyricsTermFrequencies()Terms in this song's lyrics along with their frequency.floatgetMeasuresPerMinute()Measures (bars) per minute.AudioSong.MediaKindgetMediaKind()Media kind of this object.MoodgetMood()The song's mood.StringgetMoodAlgorithm()The method the associated mood value was created with.Set<String>getMoodKeywords()Get raw mood keywords.StringgetMovement()Classical movement.intgetMovementCount()Classical movement count.intgetMovementNumber()Classical movement number.StringgetName()Name of this song.StringgetPath()Path.intgetPlayCount()Get the number of times the song was played.longgetPlayDate()Get time the song was last played.DategetPlayDateUTC()Get play date.doublegetPlayFrequency()Number of times played per 100 days.doublegetPlaySkipRatio()Play/Skip ratio.default floatgetPopularity()Popularity as a value between 0 and 1.PropertyChangeListener[]getPropertyChangeListeners()PropertyChangeListener[]getPropertyChangeListeners(String property)default URLgetPurchaseURL()URL for a website/service that allows users to purchase this song.intgetRating()Value ranging from 0-100, 100 being best.FloatgetRelativeSpectralEntropyMean()Average of relative entropy values computed for windows of length 1.486s with a hopsize of half a window.DategetReleaseDate()Release year (corresponds to id3 TDRL).default floatgetRemoteDisliked()Indicates, what percentage of people "dislike" this song.default floatgetRemoteLoved()Indicates, what percentage of people "love" this song.default floatgetRemotePlayFrequency()Average of play frequencies as reported by users.default floatgetRemotePlaySkipRatio()Play/skip ratio by all users with this song.default intgetRemoteRating()Average of other people's ratings.default DategetRemoteUpdateDate()Time the remote properties of this song were last updated.FloatgetRMSMean()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.FloatgetRMSStandardDeviation()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.intgetSampleRate()Get sample rate in Hz.intgetSeason()Get season number.SegmentsgetSegments()The song's segments.StringgetSegmentsAlgorithm()Method the segments were computed with.StringgetShow()Name of a show, suitable for TV shows.SimilaritiesgetSimilarities()The song's similarities.StringgetSimilaritiesAlgorithm()Method the similarities were computed with.longgetSize()File size.intgetSkipCount()Get skip count.DategetSkipDate()Get skip date.StringgetSortAlbum()Returns the "sort album".StringgetSortAlbumArtist()Returns the "sort album artist".StringgetSortArtist()Returns the "sort artist".StringgetSortComposer()Returns the sort composer.StringgetSortName()Returns the "sort name".StringgetSortShow()Returns the sort show.FloatgetSpectralCentroidMean()Average of the spectral centroids computed for individual windows of length ~23.22ms with a hopsize of half a window length.FloatgetSpectralFluctuationPeak()Peak of the averaged spectral fluctuation values computed for windows of length 23.22ms, with a hopsize of half a window.FloatgetSpectralFluxMean()Average of the spectral flux values computed for windows of length 23.22ms, with a hopsize of half a window.FloatgetSpectralNoveltyMean()Average of the spectral novelty values computed for windows of length 23.22ms, with a hopsize of half a window.FloatgetSpectralSpreadMean()Average of the spectral spread values computed for windows of length 23.22ms, with a hopsize of half a window.FloatgetSpectralVariabilityMean()Average of the spectral variability values computed for windows of length 23.22ms, with a hopsize of half a window.com.tagtraum.audiokern.timbre.BarkSpectrumgetSpectrum()Returns the bark spectrum.floatgetStart()Start time of the song in seconds.intgetStartTime()Start time of the song in ms.intgetStopTime()Stop time of the song in ms.default KeygetSyncTempoKey(com.tagtraum.audiokern.bpm.Tempo syncTempo)Returns the key this song would sound like, if the tempo was adjusted to the givensyncTempowithout key lock.default IntegergetSyncTempoTuning(com.tagtraum.audiokern.bpm.Tempo syncTempo)Returns the tuning this song would be in, if the tempo was adjusted to the givensyncTempowithout key lock.Set<String>getTags()Returns a set of tags associated with this song.com.tagtraum.audiokern.bpm.TempogetTempo()Returns tempo.ColorgetTempoColor()Projection ofgetTempoSpectrum()to a color.com.tagtraum.audiokern.bpm.TempoSpectrumgetTempoSpectrum()Returns the tempo spectrum.ColorgetTempoTimbreColor()Projection ofgetTempoSpectrum()andgetSpectrum()to a color.TimeSignaturegetTimeSignature()The song's time signature.StringgetTimeSignatureAlgorithm()Method the time signature was computed with.intgetTotalTime()Total length of the song in ms.intgetTrackCount()Number of tracks on album/release/recording.Set<AudioId>getTrackIds()Returns track ids.intgetTrackNumber()Get the number of the track on the release/album/recording.ReplayGaingetTrackReplayGain()Replay gain for this track (not taking other tracks in an album into account).default AudioSong.TrackTypegetTrackType()Track type.IntegergetTuning()Tuning in cents.StringgetTuningAlgorithm()The method the current tuning was created with.intgetVolumeAdjustment()Value between -255 and 255.StringgetWork()Classical work.intgetYear()Release year - (corresponds to id3 TDRC, recording time).booleanhasProtectedFileExtension()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 BooleanisAcousticBasedOnGenreTitleAndTags()booleanisAlbumRatingComputed()Indicates whether the value returned bygetAlbumRating()was computed or set manually.booleanisClean()Indicates whether this song is "clean" - whatever that means.booleanisCompilation()Indicates whether this track is part of a compilation.booleanisDisabled()Indicates whether this song is disabled or unchecked.default BooleanisElectronicBasedOnGenreAndTags()booleanisEnabled()Indicates whether this song is enabled or checked.booleanisExplicit()Indicates whether this tracks is explicit or not.booleanisHasVideo()Indicates whether this track has a video.booleanisHD()Indicates whether this video content is in high definition (HD).booleanisPartOfGaplessAlbum()Indicates whether this songs is part of a gapless album.booleanisProtected()booleanisPurchased()Indicates whether this song was purchased (via the iTunes store).booleanisRatingComputed()Indicates whether the value returned bygetRating()was computed or set manually.booleanisShared()Indicates whether this track is a shared track, i.e.booleanisUnplayed()Indicates whether this songs has been played at some point.default voidrefreshFromFile()Attempt to reload data from the underlying file.voidremovePropertyChangeListener(PropertyChangeListener listener)Lets you remove a property change listener to this song.voidremovePropertyChangeListener(String property, PropertyChangeListener listener)Lets you remove a property change listener to this song.voidsetAlbum(String album)Sets album name.voidsetAlbumArtist(String albumArtist)Sets the album artist.voidsetAlbumLiking(AudioSong.Liking liking)Set album liking.voidsetAlbumRating(int albumRating)Sets album rating.voidsetAlbumReplayGain(ReplayGain replayGain, boolean updateITunNorm)Sets the replay gain for this album.voidsetArtist(String artist)Sets artist.voidsetArtworks(AudioArtwork... artworks)Set artworks belonging to this track.voidsetBackCoverArtwork(File... backCover)Replace all back covers with the given files.voidsetBeats(Beats beats)Sets this song's beats.voidsetBeatsAlgorithm(String beatsAlgorithm)Sets the algorithm the beats were computed with.voidsetBeatsPerMinute(float bpm)Sets beats per minute.voidsetBeatsPerMinuteAlgorithm(String bpmAlgorithm)Sets the BPM algorithm.voidsetClean(boolean clean)Sets the "clean" flag.voidsetColor(Color color)Sets the color.voidsetComments(String comments)Set comments.voidsetCompilation(boolean compilation)Marks this song as part of a compilation (or not).voidsetComposer(String composer)Sets composer.voidsetContentRating(String contentRating)Sets the content rating.voidsetCustom1(String value)Custom field.voidsetCustom2(String value)Custom field.voidsetCustom3(String value)Custom field.voidsetCustom4(String value)Custom field.voidsetCustom5(String value)Custom field.voidsetDanceability(Float danceability)Danceability.voidsetDanceabilityAlgorithm(String danceabilityAlgorithm)Set the danceability algorithm.voidsetDateAnalyzed(Date date)Sets the date this song was last analyzed.voidsetDescription(String description)Sets description/subtitle.voidsetDisabled(boolean disabled)Enables/disables this song.voidsetDiscCount(int discCount)Set disc count.voidsetDiscNumber(int discNumber)Sets the disc number.voidsetEnabled(boolean enabled)Enables/disables this song.voidsetEpisode(String episode)Set episode name.voidsetEpisodeOrder(int episodeOrder)Set episode order.voidsetExplicit(boolean explicit)Sets the "explicit" flag.voidsetFingerprint(byte[] fingerprint)Sets the acoustic fingerprint.voidsetFinish(float finish)Sets the stop time in seconds.voidsetFrontCoverArtwork(File... frontCover)Replace all front covers with the given files.voidsetGenre(String genre)Sets genre.voidsetGrouping(String grouping)Sets the grouping.voidsetHasVideo(boolean hasVideo)Sets the "video" flag.voidsetHD(boolean hd)Sets the HD flag.voidsetInstrumentation(AudioSong.Instrumentation instrumentation)Sets the instrumentation property.voidsetInstrumentationAlgorithm(String instrumentationAlgorithm)Set the instrumentation algorithm.voidsetKey(Key key)Sets the tonal key.voidsetKeyAlgorithm(String keyAlgorithm)Set the key algorithm.voidsetKind(String kind)Allows you to store a String descriptor of the kind of audio object this is.voidsetLanguage(String language)Sets the language as ISO 639 three letter code.voidsetLiking(AudioSong.Liking liking)Set liking.voidsetLocation(String location)Sets the location.voidsetLoudness(Loudness loudness)Sets this song's loudness curve.voidsetLyrics(String lyrics)Sets lyrics.voidsetMediaKind(AudioSong.MediaKind kind)Set the kind of media, e.g.voidsetMood(Mood mood)Sets this song's mood.voidsetMoodAlgorithm(String moodAlgorithm)Sets the method the current mood value was created with.voidsetMoodKeywords(Set<String> moodKeywords)Attempt to store the raw mood keywordsvoidsetMovement(String movement)Classical movement.voidsetMovementCount(int count)Classical movement count.voidsetMovementNumber(int number)Classical movement number.voidsetName(String name)Sets name.voidsetPartOfGaplessAlbum(boolean partOfGaplessAlbum)Sets the "gapless album" flag.voidsetPlayCount(int playCount)Set play count.voidsetPlayDate(long playDate)Set play date in milliseconds since January 1, 1970, 00:00:00 GMT (NOT related to the iTunes value!).voidsetPlayDateUTC(Date playDateUTC)Set play time.default voidsetPopularity(float value)Sets the value locally.voidsetRating(int rating)Sets the ratingvoidsetRelativeSpectralEntropyMean(Float average)Sets the average relative spectral entropy.voidsetReleaseDate(Date releaseDate)Set release date.default voidsetRemoteDisliked(float value)Sets the value locally.default voidsetRemoteLoved(float value)Sets the value locally.default voidsetRemotePlayFrequency(float value)Sets the value locally.default voidsetRemotePlaySkipRatio(float value)Sets the value locally.default voidsetRemoteRating(int value)Sets the value locally.default voidsetRemoteUpdateDate(Date date)Sets the date that marks the last update of remote properties.voidsetRMSMean(Float average)Sets the average RMS for the first 120 seconds of this song.voidsetRMSStandardDeviation(Float standardDeviation)Sets the standard deviation of the root mean square (RMS).voidsetSeason(int season)Set season.voidsetSegments(Segments segments)Sets this song's segments.voidsetSegmentsAlgorithm(String segmentsAlgorithm)Sets the algorithm the segments were computed with.voidsetShow(String show)Set show name.voidsetSimilarities(Similarities similarities)Sets this song's similarities.voidsetSimilaritiesAlgorithm(String similaritiesAlgorithm)Sets the algorithm the similarities were computed with.voidsetSkipCount(int skipCount)Set skip count.voidsetSkipDate(Date skipDate)Set skip date.voidsetSortAlbum(String sortAlbum)Sets the sort album.voidsetSortAlbumArtist(String sortAlbumArtist)Sets the sort album artist.voidsetSortArtist(String sortArtist)Sets the sort artist.voidsetSortComposer(String sortComposer)Sets the sort composer.voidsetSortName(String sortName)Sets the sort name.voidsetSortShow(String sortShow)Sets the sort show.voidsetSpectralCentroidMean(Float average)Sets the mean of the spectral centroids.voidsetSpectralFluctuationPeak(Float peak)Peak of the spectral fluctuation values computed for windows of length 23.22ms, with a hopsize of half a window.voidsetSpectralFluxMean(Float averageSpectralFlux)Sets the mean spectral flux.voidsetSpectralNoveltyMean(Float average)Sets the average spectral novelty.voidsetSpectralSpreadMean(Float average)Sets the average spectral spread.voidsetSpectralVariabilityMean(Float averageSpectralVariability)Sets the mean spectral variability.voidsetSpectrum(com.tagtraum.audiokern.timbre.BarkSpectrum spectrum)Sets the bark spectrum.voidsetStart(float start)Sets the start time in seconds.voidsetStartTime(int startTime)Set start time in ms.voidsetStopTime(int stopTime)Sets stop time.voidsetTags(Set<String> tags)Sets a new set of tags.voidsetTempo(com.tagtraum.audiokern.bpm.Tempo tempo)Sets the tempo.voidsetTempoColor(Color value)Sets this song's tempo color.voidsetTempoSpectrum(com.tagtraum.audiokern.bpm.TempoSpectrum value)Sets the tempo spectrum.voidsetTempoTimbreColor(Color value)Sets this song's tempo-timbre color.voidsetTimeSignature(TimeSignature timeSignature)Sets this song's time signature.voidsetTimeSignatureAlgorithm(String timeSignatureAlgorithm)Sets the algorithm the time signature was computed with.voidsetTrackCount(int trackCount)Set track countvoidsetTrackNumber(int trackNumber)Set the number of this track.voidsetTrackReplayGain(ReplayGain replayGain, boolean updateITunNorm)Sets the replay gain for this track, not taking other tracks of the album into account.voidsetTrackType(AudioSong.TrackType trackType)Field used by iTunes - typicallyAudioSong.TrackType.FILEfor files andAudioSong.TrackType.URLfor..voidsetTuning(Integer tuning)Sets tuning in cents (+-50).voidsetTuningAlgorithm(String tuningAlgorithm)Sets the tuning algorithm the current tuning value was computed with.voidsetUnplayed(boolean unplayed)Sets unplayed.voidsetVolumeAdjustment(int volumeAdjustment)Sets the volume adjustmentvoidsetWork(String work)Classical work.voidsetYear(int year)Sets the year.
-
-
-
Method Detail
-
getImplementation
<T> T getImplementation(Class<T> klass)
AudioSongobjects 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, UnsupportedOperationExceptionAttempt 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
PropertyChangeListenerfor one of the propertiesshared,trackTypeorlocation.- 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.xmland may simply benullfor 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:
trueorfalse
-
isAlbumRatingComputed
boolean isAlbumRatingComputed()
Indicates whether the value returned bygetAlbumRating()was computed or set manually.- Returns:
trueorfalse
-
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:
trueorfalse
-
setCompilation
void setCompilation(boolean compilation)
Marks this song as part of a compilation (or not).- Parameters:
compilation-trueorfalse
-
getId
Long getId()
Persistent id. Survives application shutdown.- Returns:
- persistent id
-
isEnabled
boolean isEnabled()
Indicates whether this song is enabled or checked.- Returns:
trueorfalse
-
setEnabled
void setEnabled(boolean enabled)
Enables/disables this song.- Parameters:
enabled-trueorfalse
-
isDisabled
boolean isDisabled()
Indicates whether this song is disabled or unchecked.- Returns:
- !
isEnabled()
-
setDisabled
void setDisabled(boolean disabled)
Enables/disables this song.- Parameters:
disabled-trueorfalse
-
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.FILEfor files andAudioSong.TrackType.URLfor.. 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:
trueorfalse
-
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:
trueorfalse- See Also:
isExplicit()
-
setClean
void setClean(boolean clean)
Sets the "clean" flag. "Clean" and "explicit" are mutually exclusive.- Parameters:
clean-trueorfalse- See Also:
setExplicit(boolean)
-
isExplicit
boolean isExplicit()
Indicates whether this tracks is explicit or not. "Clean" and "explicit" are mutually exclusive.- Returns:
trueorfalse- See Also:
isClean()
-
setExplicit
void setExplicit(boolean explicit)
Sets the "explicit" flag. "Clean" and "explicit" are mutually exclusive.- Parameters:
explicit-trueorfalse- See Also:
setClean(boolean)
-
isHasVideo
boolean isHasVideo()
Indicates whether this track has a video.- Returns:
trueorfalse
-
setHasVideo
void setHasVideo(boolean hasVideo)
Sets the "video" flag.- Parameters:
hasVideo-trueorfalse
-
isProtected
boolean isProtected()
- Returns:
trueorfalse
-
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. Ifrefreshis 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:
trueorfalse
-
setPartOfGaplessAlbum
void setPartOfGaplessAlbum(boolean partOfGaplessAlbum)
Sets the "gapless album" flag.- Parameters:
partOfGaplessAlbum-trueorfalse
-
isHD
boolean isHD()
Indicates whether this video content is in high definition (HD).- Returns:
trueorfalse
-
setHD
void setHD(boolean hd)
Sets the HD flag.- Parameters:
hd-trueorfalse
-
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:
trueorfalse
-
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. Ifrefreshis 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 givensyncTempowithout 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 givensyncTempowithout 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
-
-