Interface AudioSong

    • Field Detail

      • ACOUSTIC_NAMES

        static final Set<String> ACOUSTIC_NAMES
      • ELECTRONIC_NAMES

        static final Set<String> ELECTRONIC_NAMES
    • 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)
      • 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 properties shared, trackType or location.

        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 from iTunes Music Library.xml and may simply be null 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 (with getKind()) 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()
      • 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 gain
        updateITunNorm - update the iTunNorm field with the given value
        See Also:
        getTrackReplayGain(), getAlbumReplayGain()
      • setAlbumReplayGain

        void setAlbumReplayGain​(ReplayGain replayGain,
                                boolean updateITunNorm)
        Sets the replay gain for this album.
        Parameters:
        replayGain - replay gain
        updateITunNorm - 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. Returns 0, 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
      • 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
      • setRating

        void setRating​(int rating)
        Sets the rating
        Parameters:
        rating - rating between from 0 to 100
        See Also:
        getRating()
      • setAlbumRating

        void setAlbumRating​(int albumRating)
        Sets album rating.
        Parameters:
        albumRating - album rating
      • isRatingComputed

        boolean isRatingComputed()
        Indicates whether the value returned by getRating() was computed or set manually.
        Returns:
        true or false
      • isAlbumRatingComputed

        boolean isAlbumRatingComputed()
        Indicates whether the value returned by getAlbumRating() was computed or set manually.
        Returns:
        true or false
      • 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 or false
      • setCompilation

        void setCompilation​(boolean compilation)
        Marks this song as part of a compilation (or not).
        Parameters:
        compilation - true or false
      • getId

        Long getId()
        Persistent id. Survives application shutdown.
        Returns:
        persistent id
      • isEnabled

        boolean isEnabled()
        Indicates whether this song is enabled or checked.
        Returns:
        true or false
      • setEnabled

        void setEnabled​(boolean enabled)
        Enables/disables this song.
        Parameters:
        enabled - true or false
      • 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 or false
      • isUnplayed

        boolean isUnplayed()
        Indicates whether this songs has been played at some point.
        Returns:
        true or false
      • 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 or false
        See Also:
        isExplicit()
      • setClean

        void setClean​(boolean clean)
        Sets the "clean" flag. "Clean" and "explicit" are mutually exclusive.
        Parameters:
        clean - true or false
        See Also:
        setExplicit(boolean)
      • isExplicit

        boolean isExplicit()
        Indicates whether this tracks is explicit or not. "Clean" and "explicit" are mutually exclusive.
        Returns:
        true or false
        See Also:
        isClean()
      • setExplicit

        void setExplicit​(boolean explicit)
        Sets the "explicit" flag. "Clean" and "explicit" are mutually exclusive.
        Parameters:
        explicit - true or false
        See Also:
        setClean(boolean)
      • isHasVideo

        boolean isHasVideo()
        Indicates whether this track has a video.
        Returns:
        true or false
      • setHasVideo

        void setHasVideo​(boolean hasVideo)
        Sets the "video" flag.
        Parameters:
        hasVideo - true or false
      • isProtected

        boolean isProtected()
        Indicates whether this track is protected by some DRM scheme like Apple's FairPlay.
        Returns:
        true or false
      • 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 calls getLocation(boolean) with refresh = false.
        Returns:
        location
      • getLocation

        String getLocation​(boolean refresh)
        Location of this track. If refresh 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 or false
      • setPartOfGaplessAlbum

        void setPartOfGaplessAlbum​(boolean partOfGaplessAlbum)
        Sets the "gapless album" flag.
        Parameters:
        partOfGaplessAlbum - true or false
      • isHD

        boolean isHD()
        Indicates whether this video content is in high definition (HD).
        Returns:
        true or false
      • setHD

        void setHD​(boolean hd)
        Sets the HD flag.
        Parameters:
        hd - true or false
      • 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 or false
      • getPlayFrequency

        double getPlayFrequency()
        Number of times played per 100 days.
        Returns:
        played per 100 days
        See Also:
        getRemotePlayFrequency()
      • getFile

        default Path getFile()
        File of this song, or null, if it cannot be found. The default implementation simply calls getFile(boolean) with refresh = 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. If refresh 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.
      • setTempoColor

        void setTempoColor​(Color value)
        Sets this song's tempo color.
        Parameters:
        value - color
      • 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()
      • 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 use setTags(java.util.Set) and don't manipulate the returned set.
        Returns:
        set of tags
      • setTags

        void setTags​(Set<String> tags)
        Sets a new set of tags.
        Parameters:
        tags - set of strings
      • 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 given syncTempo 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 given syncTempo 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()
      • getKeyAlgorithm

        String getKeyAlgorithm()
        Returns the name of the key algorithm. May be Entered, if the key value was entered.
        Returns:
        key algorithm
      • setKeyAlgorithm

        void setKeyAlgorithm​(String keyAlgorithm)
        Set the key algorithm. Should be Entered, 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
      • getMoodKeywords

        Set<String> getMoodKeywords()
        Get raw mood keywords.
        Returns:
        mood keywords
      • getTrackIds

        Set<AudioId> getTrackIds()
        Returns track ids.
        Returns:
        track ids
      • getAlbumIds

        Set<AudioId> getAlbumIds()
        Get album ids.
        Returns:
        album ids
      • getArtistIds

        Set<AudioId> getArtistIds()
        Get artists ids.
        Returns:
        artist ids
      • 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
      • getTuning

        Integer getTuning()
        Tuning in cents.
        Returns:
        cents
      • 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 from getBeatsPerMinute() and getTimeSignature(). 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 be Entered, if the value was entered.
        Returns:
        danceability algorithm
      • setDanceabilityAlgorithm

        void setDanceabilityAlgorithm​(String danceabilityAlgorithm)
        Set the danceability algorithm. Should be Entered, 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
      • 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 be Entered, if the value was entered.
        Returns:
        instrumentation algorithm
      • setInstrumentationAlgorithm

        void setInstrumentationAlgorithm​(String instrumentationAlgorithm)
        Set the instrumentation algorithm. Should be Entered, 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()
      • 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
      • 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
      • setSpectralCentroidMean

        void setSpectralCentroidMean​(Float average)
        Sets the mean of the spectral centroids.
        Parameters:
        average - averaged spectral centroids
        See Also:
        getSpectralCentroidMean()
      • setSpectralSpreadMean

        void setSpectralSpreadMean​(Float average)
        Sets the average spectral spread.
        Parameters:
        average - average spectral spread
        See Also:
        getSpectralSpreadMean()
      • 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()
      • setSpectralFluxMean

        void setSpectralFluxMean​(Float averageSpectralFlux)
        Sets the mean spectral flux.
        Parameters:
        averageSpectralFlux - average spectral flux
        See Also:
        getSpectralFluxMean()
      • setSpectralVariabilityMean

        void setSpectralVariabilityMean​(Float averageSpectralVariability)
        Sets the mean spectral variability.
        Parameters:
        averageSpectralVariability - average spectral variability
        See Also:
        getSpectralVariabilityMean()
      • 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...)
      • 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