Class AudioMetaData
- java.lang.Object
-
- com.tagtraum.audiokern.AudioMetaData
-
- All Implemented Interfaces:
AudioSong
public abstract class AudioMetaData extends Object implements AudioSong
Provides access to metadata taken from id3 tags and other mechanisms of embedding metadata into music files.Note that the setters offered in this class actually write to the audio file. So be careful when you call them! Make sure nobody else (e.g. iTunes) is writing at the same time and that the properties you are writing aren't stale.
Failure are typically reported as
AudioMetaDataException
In order to call a couple of methods and then write (and not each time) you can call
beginTransaction()
andcommit()
to write properties transactionally.- Author:
- Hendrik Schreiber
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AudioMetaData.DateParser
Thread-safe parser for common date strings.-
Nested classes/interfaces inherited from interface com.tagtraum.audiokern.AudioSong
AudioSong.CloudStatus, AudioSong.Instrumentation, AudioSong.Liking, AudioSong.MediaKind, AudioSong.TrackType
-
-
Field Summary
Fields Modifier and Type Field Description protected org.jaudiotagger.audio.AudioFile
audioFile
protected static AudioMetaData.DateParser
DATE_PARSER
protected Path
file
protected static String
FMPS_PLAYCOUNT
protected static String
FMPS_RATING
protected static String
MIK_INITIAL_KEY
static String
UFID_TUNECORTEX_COM
-
Fields inherited from interface com.tagtraum.audiokern.AudioSong
ACOUSTIC_NAMES, ELECTRONIC_NAMES
-
-
Constructor Summary
Constructors Constructor Description AudioMetaData()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addArtwork(AudioArtwork audioArtwork)
Adds an artwork/image to the audio song.void
addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
Lets you add a property change listener to this song.void
addPropertyChangeListener(String property, PropertyChangeListener propertyChangeListener)
Lets you add a property change listener to this song.protected void
autoCommit()
Called by all the setters to commit, should we not be transactional.void
beginTransaction()
Makes this AudioMetaData object transactional - i.e.void
beginTransaction(boolean readFresh)
Makes this AudioMetaData object transactional - i.e.boolean
canWrite()
Checks whether the file corresponding to this song can in principal be written to.void
commit()
Writes all changes to disk.void
commit(boolean detectConcurrentModification)
Writes all changes to disk.protected static org.jaudiotagger.tag.images.Artwork
createArtwork(AudioArtwork audioArtwork)
void
download()
Allows downloading of shared (e.g.String
dump()
abstract void
dump(org.jaudiotagger.tag.TagField tagField, StringBuilder sb)
static AudioMetaData
get(Path file)
Creates anAudioMetaData
object for the given file if possible.static AudioMetaData
get(Path file, BasicFileAttributes basicFileAttributes, FileId fileId, boolean lazyRead)
Creates anAudioMetaData
object for the given file if possible.String
getAlbum()
Get Album.String
getAlbumArtist()
Get album artist.Set<AudioId>
getAlbumIds()
Get album ids.AudioSong.Liking
getAlbumLiking()
Is album liked.int
getAlbumRating()
Get album rating.ReplayGain
getAlbumReplayGain()
Replay gain for this album.String
getArtist()
Get artist.Set<AudioId>
getArtistIds()
Get artists ids.int
getArtworkCount()
Get artwork count.AudioArtwork[]
getArtworks()
Artwork belonging to this song.String
getASIN()
protected org.jaudiotagger.audio.AudioFile
getAudioFile()
Image
getBackCoverImage()
Returns the first front cover image.String
getBarcode()
String
getBeatportTrackId()
Beats
getBeats()
The song's beats.String
getBeatsAlgorithm()
Method the beats were computed with.float
getBeatsPerMinute()
Beats per minute (BPM).String
getBeatsPerMinuteAlgorithm()
Returns the name of the algorithm used to determine the beats per minute (BPM).int
getBitRate()
Bit rate.int
getChannels()
String
getChannelsAsString()
AudioSong.CloudStatus
getCloudStatus()
Returns the cloud status, if available.Color
getColor()
Returns the color.String
getComments()
Get comments.String
getComposer()
Get composer(s).String
getContentRating()
Returns the content rating.String
getCustom1()
Custom field.String
getCustom2()
Custom field.String
getCustom3()
Custom field.String
getCustom4()
Custom field.String
getCustom5()
Custom field.Float
getDanceability()
Danceability.String
getDanceabilityAlgorithm()
Returns the name of the danceability algorithm.Date
getDateAdded()
Get date the song was added to the library.Date
getDateAnalyzed()
Date the song was last analyzed.Date
getDateModified()
Get date of last modification.String
getDescription()
Description/subtitle of this song.int
getDiscCount()
Assuming that this song is on a disc that is part of a disc collection, return the number of discs in this collection.int
getDiscNumber()
Get the disc number.String
getDiscogsArtistURL()
String
getDiscogsReleaseURL()
String
getEncoder()
String
getEpisode()
Get episode name.int
getEpisodeOrder()
Episode order.static ExecutorService
getExecutorService()
SpecialExecutorService
for synchronizing access to audiometadata resources.Path
getFile(boolean refresh)
File of this track.FileId
getFileId()
byte[]
getFingerprint()
Returns beaTunes fingerprint.float
getFinish()
Stop time of the song in seconds.Image
getFrontCoverImage()
Returns the first front cover image.String
getGenre()
Get genre.String
getGrouping()
Get grouping.Long
getId()
Persistent id.Image
getImage()
Returns an embedded image from the AudioMetaData.Image[]
getImages()
All images.<T> T
getImplementation(Class<T> klass)
AudioSong
objects are sometimes implemented by an object that acts as a facade to other AudioSong objects.List<AudioSong>
getImplementations()
Returns implementations of this interface instance.AudioSong.Instrumentation
getInstrumentation()
Indicates whether this song qualifies as "electronic" or "acoustic".String
getInstrumentationAlgorithm()
Returns the name of the instrumentation algorithm.String
getISRC()
protected abstract com.tagtraum.audiokern.audiometadata.ITunNORM
getITunNORM()
Key
getKey()
Return the tonal key of this song.String
getKeyAlgorithm()
Returns the name of the key algorithm.static KeyFormat
getKeyFormat()
String
getKind()
Kind of audio, e.g.String
getLanguage()
The language of the lyrics as ISO 639 three letter codes.AudioSong.Liking
getLiking()
Liking.String
getLocation(boolean refresh)
Location of this track.Loudness
getLoudness()
The song's loudness curve.String
getLyrics()
Returns the lyrics.List<TermFrequency>
getLyricsTermFrequencies()
Terms in this song's lyrics along with their frequency.float
getMeasuresPerMinute()
Measures (bars) per minute.AudioSong.MediaKind
getMediaKind()
Media kind of this object.Mood
getMood()
The song's mood.String
getMoodAlgorithm()
The method the associated mood value was created with.Set<String>
getMoodKeywords()
Get raw mood keywords.String
getMovement()
Classical movement.int
getMovementCount()
Classical movement count.int
getMovementNumber()
Classical movement number.String
getMusicBrainzAlbumArtistId()
String
getMusicBrainzAlbumId()
String
getMusicBrainzArtistId()
String
getMusicBrainzReleaseGroupId()
String
getMusicBrainzTrackId()
String
getMusicIPPUID()
String
getName()
Name of this song.static int
getNotFoundCheckMaxAgeInMs()
String
getOfficialArtistURL()
String
getOfficialReleaseURL()
String
getPath()
Path.long
getPlayDate()
Get time the song was last played.Date
getPlayDateUTC()
Get play date.double
getPlayFrequency()
Number of times played per 100 days.double
getPlaySkipRatio()
Play/Skip ratio.PropertyChangeListener[]
getPropertyChangeListeners()
PropertyChangeListener[]
getPropertyChangeListeners(String property)
int
getRating()
Value ranging from 0-100, 100 being best.Float
getRelativeSpectralEntropyMean()
Average of relative entropy values computed for windows of length 1.486s with a hopsize of half a window.Float
getRMSMean()
Root mean square (RMS) of the signal's energy, averaged over windows of length ~23ms (actually 1024/44100 frames for a signal with sample rate 44.1kHz, i.e.Float
getRMSStandardDeviation()
Standard deviation of the root mean square energy values for windows of length ~23ms (actually 1024/44100 frames for a signal with sample rate 44.1kHz) with a hopsize of half a window.int
getSampleRate()
Get sample rate in Hz.int
getSeason()
Get season number.Segments
getSegments()
The song's segments.String
getSegmentsAlgorithm()
Method the segments were computed with.String
getShow()
Name of a show, suitable for TV shows.Similarities
getSimilarities()
The song's similarities.String
getSimilaritiesAlgorithm()
Method the similarities were computed with.long
getSize()
File size.int
getSkipCount()
Get skip count.Date
getSkipDate()
Get skip date.String
getSortAlbum()
Returns the "sort album".String
getSortAlbumArtist()
Returns the "sort album artist".String
getSortArtist()
Returns the "sort artist".String
getSortComposer()
Returns the sort composer.String
getSortName()
Returns the "sort name".String
getSortShow()
Returns the sort show.abstract String
getSpecification()
abstract String
getSpecificationVersion()
Float
getSpectralCentroidMean()
Average of the spectral centroids computed for individual windows of length ~23.22ms with a hopsize of half a window length.Float
getSpectralFluctuationPeak()
Peak of the averaged spectral fluctuation values computed for windows of length 23.22ms, with a hopsize of half a window.Float
getSpectralFluxMean()
Average of the spectral flux values computed for windows of length 23.22ms, with a hopsize of half a window.Float
getSpectralNoveltyMean()
Average of the spectral novelty values computed for windows of length 23.22ms, with a hopsize of half a window.Float
getSpectralSpreadMean()
Average of the spectral spread values computed for windows of length 23.22ms, with a hopsize of half a window.Float
getSpectralVariabilityMean()
Average of the spectral variability values computed for windows of length 23.22ms, with a hopsize of half a window.com.tagtraum.audiokern.timbre.BarkSpectrum
getSpectrum()
Returns the bark spectrum.float
getStart()
Start time of the song in seconds.int
getStartTime()
Start time of the song in ms.int
getStopTime()
Stop time of the song in ms.protected org.jaudiotagger.tag.Tag
getTag()
Set<String>
getTags()
Returns a set of tags associated with this song.com.tagtraum.audiokern.bpm.Tempo
getTempo()
Returns tempo.Color
getTempoColor()
Projection ofAudioSong.getTempoSpectrum()
to a color.com.tagtraum.audiokern.bpm.TempoSpectrum
getTempoSpectrum()
Returns the tempo spectrum.Color
getTempoTimbreColor()
Projection ofAudioSong.getTempoSpectrum()
andAudioSong.getSpectrum()
to a color.TimeSignature
getTimeSignature()
The song's time signature.String
getTimeSignatureAlgorithm()
Method the time signature was computed with.int
getTotalTime()
Total length of the song in ms.int
getTrackCount()
Number of tracks on album/release/recording.Set<AudioId>
getTrackIds()
Returns track ids.int
getTrackNumber()
Get the number of the track on the release/album/recording.ReplayGain
getTrackReplayGain()
Replay gain for this track (not taking other tracks in an album into account).protected ReplayGain
getTrackReplayGainFromITunNORM()
AudioSong.TrackType
getTrackType()
Track type.Long
getTuneCortexID()
Integer
getTuning()
Tuning in cents.String
getTuningAlgorithm()
The method the current tuning was created with.protected Float
getUniqueFloatTextFrame(String key)
protected Integer
getUniqueIntTextFrame(String key)
protected long
getUniqueLongTextFrame(String key)
protected abstract String
getUniqueTextFrame(String name)
Gets a unique text frame.protected String
getUniqueURLFrame(String name)
Sets a value as url frame, replacing any url frame with the same name/description.int
getVolumeAdjustment()
Value between -255 and 255.String
getWikipediaArtistURL()
String
getWikipediaReleaseURL()
String
getWork()
Classical work.int
getYear()
Release year - (corresponds to id3 TDRC, recording time).String
getYouTubeURL()
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.static Future<?>
invokeLater(Runnable runnable)
Executes the runnable asynchronously in the executor thread.boolean
isAlbumRatingComputed()
Indicates whether the value returned byAudioSong.getAlbumRating()
was computed or set manually.boolean
isClean()
Indicates whether this song is "clean" - whatever that means.boolean
isCompilation()
Indicates whether this track is part of a compilation.boolean
isDirty()
Indicates whether we are in a transaction and the object has been changed, but not written yet.boolean
isDisabled()
Indicates whether this song is disabled or unchecked.boolean
isEnabled()
Indicates whether this song is enabled or checked.boolean
isExplicit()
Indicates whether this tracks is explicit or not.boolean
isHasVideo()
Indicates whether this track has a video.boolean
isHD()
Indicates whether this video content is in high definition (HD).boolean
isPartOfGaplessAlbum()
Indicates whether this songs is part of a gapless album.boolean
isProtected()
boolean
isPurchased()
Indicates whether this song was purchased (via the iTunes store).boolean
isRatingComputed()
Indicates whether the value returned byAudioSong.getRating()
was computed or set manually.boolean
isShared()
Indicates whether this track is a shared track, i.e.static boolean
isSupported(String fileExtensionWithoutDot)
Indicates whether meta data can be read and potentially manipulated.static boolean
isSupported(Path path)
Indicates whether meta data can be read and potentially manipulated.boolean
isTransactional()
Indicates whether this object behaves transactionally.boolean
isUnplayed()
Indicates whether this songs has been played at some point.static void
main(String[] args)
void
refreshFromFile()
Attempt to reload data from the underlying file.void
removePropertyChangeListener(PropertyChangeListener listener)
Lets you remove a property change listener to this song.void
removePropertyChangeListener(String property, PropertyChangeListener listener)
Lets you remove a property change listener to this song.void
rollback()
Reads the underlying data fresh from diskvoid
setAlbum(String album)
Sets album name.void
setAlbumArtist(String albumArtist)
Sets the album artist.void
setAlbumLiking(AudioSong.Liking liking)
Set album liking.void
setAlbumRating(int albumRating)
Sets album rating.void
setAlbumReplayGain(ReplayGain replayGain, boolean updateITunNorm)
Sets the replay gain for this album.void
setArtist(String artist)
Sets artist.void
setArtwork(File f)
void
setArtworks(AudioArtwork... audioArtworks)
Set artworks belonging to this track.void
setASIN(String asin)
void
setBackCoverArtwork(File... backCovers)
Replace all back covers with the given files.void
setBarcode(String barcode)
void
setBeats(Beats beats)
Sets this song's beats.void
setBeatsAlgorithm(String beatsAlgorithm)
Sets the algorithm the beats were computed with.void
setBeatsPerMinute(float fBPM)
Sets beats per minute.void
setBeatsPerMinuteAlgorithm(String bpmAlgorithm)
Sets the BPM algorithm.void
setClean(boolean clean)
Sets the "clean" flag.void
setColor(Color color)
Sets the color.void
setComments(String comments)
Set comments.void
setCompilation(boolean compilation)
Marks this song as part of a compilation (or not).void
setComposer(String composer)
Sets composer.void
setContentRating(String contentRating)
Sets the content rating.void
setCustom1(String value)
Custom field.void
setCustom2(String value)
Custom field.void
setCustom3(String value)
Custom field.void
setCustom4(String value)
Custom field.void
setCustom5(String value)
Custom field.void
setDanceability(Float danceability)
Danceability.void
setDanceabilityAlgorithm(String danceabilityAlgorithm)
Set the danceability algorithm.void
setDateAnalyzed(Date date)
Sets the date this song was last analyzed.void
setDescription(String name)
Sets description/subtitle.void
setDisabled(boolean disabled)
Enables/disables this song.void
setDiscCount(int discCount)
Set disc count.void
setDiscNumber(int discNumber)
Sets the disc number.void
setDiscogsArtistURL(String url)
void
setDiscogsReleaseURL(String url)
void
setEnabled(boolean enabled)
Enables/disables this song.void
setEpisode(String episode)
Set episode name.void
setEpisodeOrder(int episodeOrder)
Set episode order.void
setExplicit(boolean explicit)
Sets the "explicit" flag.void
setFile(Path file)
void
setFingerprint(byte[] fingerprint)
Writes a beaTunes fingerprintvoid
setFinish(float finish)
Sets the stop time in seconds.void
setFrontCoverArtwork(File... frontCovers)
Replace all front covers with the given files.void
setGenre(String genre)
Sets genre.void
setGrouping(String grouping)
Sets the grouping.void
setHasVideo(boolean hasVideo)
Sets the "video" flag.void
setHD(boolean hd)
Sets the HD flag.void
setInstrumentation(AudioSong.Instrumentation instrumentation)
Sets the instrumentation property.void
setInstrumentationAlgorithm(String instrumentationAlgorithm)
Set the instrumentation algorithm.void
setISRC(String isrc)
static void
setITunes12_6WorkGroupingMode(boolean enableMode)
Enables the special iTunes 12.6 grouping/work mode.protected abstract void
setITunNORM(com.tagtraum.audiokern.audiometadata.ITunNORM iTunNORM)
void
setKey(Key key)
Sets the tonal key.void
setKey(String key)
Allows writing the key value in some custom format (NOT RECOMMENDED!!).void
setKeyAlgorithm(String keyAlgorithm)
Set the key algorithm.static void
setKeyFormat(KeyFormat keyFormat)
void
setKind(String kind)
Allows you to store a String descriptor of the kind of audio object this is.void
setLanguage(String threeCharLanguageCode)
Sets the language as ISO 639 three letter code.void
setLiking(AudioSong.Liking liking)
Set liking.void
setLocation(String location)
Sets the location.void
setLoudness(Loudness loudness)
Sets this song's loudness curve.void
setLyrics(String lyrics)
Sets lyrics.void
setMediaKind(AudioSong.MediaKind kind)
Set the kind of media, e.g.void
setMood(Mood mood)
Sets this song's mood.void
setMoodAlgorithm(String moodAlgorithm)
Sets the method the current mood value was created with.void
setMoodKeywords(Set<String> moodKeywords)
Attempt to store the raw mood keywordsvoid
setMovement(String movement)
Classical movement.void
setMovementCount(int count)
Classical movement count.void
setMovementNumber(int number)
Classical movement number.void
setMusicBrainzAlbumArtistId(String id)
void
setMusicBrainzAlbumId(String id)
void
setMusicBrainzArtistId(String id)
void
setMusicBrainzReleaseGroupId(String id)
void
setMusicBrainzTrackId(String id)
void
setMusicIPPUID(String puid)
void
setName(String name)
Sets name.static void
setNotFoundCheckMaxAgeInMS(int notFoundCheckMaxAgeInMs)
void
setOfficialArtistURL(String url)
void
setOfficialReleaseURL(String url)
void
setPartOfGaplessAlbum(boolean partOfGaplessAlbum)
Sets the "gapless album" flag.void
setPlayDate(long playDate)
Set play date in milliseconds since January 1, 1970, 00:00:00 GMT (NOT related to the iTunes value!).void
setPlayDateUTC(Date playDateUTC)
Set play time.void
setRating(int rating)
Sets the ratingvoid
setRelativeSpectralEntropyMean(Float average)
Sets the average relative spectral entropy.void
setRMSMean(Float average)
Sets the average RMS for the first 120 seconds of this song.void
setRMSStandardDeviation(Float standardDeviation)
Sets the standard deviation of the root mean square (RMS).void
setSeason(int season)
Set season.void
setSegments(Segments segments)
Sets this song's segments.void
setSegmentsAlgorithm(String segmentsAlgorithm)
Sets the algorithm the segments were computed with.void
setShow(String show)
Set show name.void
setSimilarities(Similarities similarities)
Sets this song's similarities.void
setSimilaritiesAlgorithm(String similaritiesAlgorithm)
Sets the algorithm the similarities were computed with.void
setSkipCount(int skipCount)
Set skip count.void
setSkipDate(Date skipDate)
Set skip date.void
setSortAlbum(String sortAlbum)
Sets the sort album.void
setSortAlbumArtist(String sortAlbumArtist)
Sets the sort album artist.void
setSortArtist(String sortArtist)
Sets the sort artist.void
setSortComposer(String sortComposer)
Sets the sort composer.void
setSortName(String sortName)
Sets the sort name.void
setSortShow(String sortShow)
Sets the sort show.void
setSpectralCentroidMean(Float average)
Sets the mean of the spectral centroids.void
setSpectralFluctuationPeak(Float peak)
Peak of the spectral fluctuation values computed for windows of length 23.22ms, with a hopsize of half a window.void
setSpectralFluxMean(Float flux)
Sets the mean spectral flux.void
setSpectralNoveltyMean(Float average)
Sets the average spectral novelty.void
setSpectralSpreadMean(Float average)
Sets the average spectral spread.void
setSpectralVariabilityMean(Float variability)
Sets the mean spectral variability.void
setSpectrum(com.tagtraum.audiokern.timbre.BarkSpectrum spectrum)
Sets the bark spectrum.void
setStart(float finish)
Sets the start time in seconds.void
setStartTime(int startTime)
Set start time in ms.void
setStopTime(int stopTime)
Sets stop time.protected void
setTag(org.jaudiotagger.tag.FieldKey key, String value)
void
setTags(Set<String> tags)
Sets a new set of tags.protected void
setTags(org.jaudiotagger.tag.FieldKey key, String[] values)
void
setTempo(com.tagtraum.audiokern.bpm.Tempo tempo)
Sets the tempo.void
setTempoColor(Color color)
Sets this song's tempo color.void
setTempoSpectrum(com.tagtraum.audiokern.bpm.TempoSpectrum spectrum)
Sets the tempo spectrum.void
setTempoTimbreColor(Color color)
Sets this song's tempo-timbre color.void
setTimeSignature(TimeSignature timeSignature)
Sets this song's time signature.void
setTimeSignatureAlgorithm(String timeSignatureAlgorithm)
Sets the algorithm the time signature was computed with.void
setTrackCount(int trackCount)
Set track countvoid
setTrackNumber(int trackNumber)
Set the number of this track.void
setTrackReplayGain(ReplayGain replayGain, boolean updateITunNorm)
Sets the replay gain for this track, not taking other tracks of the album into account.void
setTrackType(AudioSong.TrackType trackType)
Field used by iTunes - typicallyAudioSong.TrackType.FILE
for files andAudioSong.TrackType.URL
for..void
setTuneCortexID(Long id)
void
setTuning(Integer tuning)
Sets tuning in cents (+-50).void
setTuningAlgorithm(String tuningAlgorithm)
Sets the tuning algorithm the current tuning value was computed with.protected void
setUniqueFloatTextFrame(String key, Float value)
protected abstract void
setUniqueTextFrame(String name, String value)
Sets a value as text frame, replacing any text frame with the same name/description.protected void
setUniqueURLFrame(String name, String url)
Gets a unique URL frame.void
setUnplayed(boolean unplayed)
Sets unplayed.void
setVolumeAdjustment(int volumeAdjustment)
Sets the volume adjustmentvoid
setWikipediaArtistURL(String url)
void
setWikipediaReleaseURL(String url)
void
setWork(String work)
Classical work.void
setYear(int year)
Sets the year.void
setYouTubeURL(String url)
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.tagtraum.audiokern.AudioSong
addBackCoverArtwork, addFrontCoverArtwork, getFile, getInstrumentationBasedOnGenreAndTags, getLocation, getPlayCount, getPopularity, getPurchaseURL, getReleaseDate, getRemoteDisliked, getRemoteLoved, getRemotePlayFrequency, getRemotePlaySkipRatio, getRemoteRating, getRemoteUpdateDate, getSyncTempoKey, getSyncTempoTuning, isAcousticBasedOnGenreTitleAndTags, isElectronicBasedOnGenreAndTags, setPlayCount, setPopularity, setReleaseDate, setRemoteDisliked, setRemoteLoved, setRemotePlayFrequency, setRemotePlaySkipRatio, setRemoteRating, setRemoteUpdateDate
-
-
-
-
Field Detail
-
FMPS_RATING
protected static final String FMPS_RATING
- See Also:
- Constant Field Values
-
FMPS_PLAYCOUNT
protected static final String FMPS_PLAYCOUNT
- See Also:
- Constant Field Values
-
MIK_INITIAL_KEY
protected static final String MIK_INITIAL_KEY
- See Also:
- Constant Field Values
-
file
protected Path file
-
audioFile
protected org.jaudiotagger.audio.AudioFile audioFile
-
UFID_TUNECORTEX_COM
public static final String UFID_TUNECORTEX_COM
- See Also:
- Constant Field Values
-
DATE_PARSER
protected static final AudioMetaData.DateParser DATE_PARSER
-
-
Method Detail
-
setITunes12_6WorkGroupingMode
public static void setITunes12_6WorkGroupingMode(boolean enableMode)
Enables the special iTunes 12.6 grouping/work mode. When enabled, grouping is written toGRP1
and work toTIT1
. When disabled, grouping is written toTIT1
and work to a custom field.- Parameters:
enableMode
- true to enable
-
getNotFoundCheckMaxAgeInMs
public static int getNotFoundCheckMaxAgeInMs()
-
setNotFoundCheckMaxAgeInMS
public static void setNotFoundCheckMaxAgeInMS(int notFoundCheckMaxAgeInMs)
-
getKeyFormat
public static KeyFormat getKeyFormat()
-
setKeyFormat
public static void setKeyFormat(KeyFormat keyFormat)
-
isSupported
public static boolean isSupported(Path path)
Indicates whether meta data can be read and potentially manipulated.- Parameters:
path
- file- Returns:
- true, if we can process the given file.
- See Also:
isSupported(String)
-
isSupported
public static boolean isSupported(String fileExtensionWithoutDot)
Indicates whether meta data can be read and potentially manipulated.- Parameters:
fileExtensionWithoutDot
- file extension without dot: "exe"- Returns:
- true, if we can process the given file type.
- See Also:
isSupported(Path)
-
get
public static AudioMetaData get(Path file) throws UnsupportedAudioFileException, IOException
Creates anAudioMetaData
object for the given file if possible. Contents of the file will only be read, if any of the properties are accessed.- Parameters:
file
- file- Returns:
AudioMetaData
object- Throws:
UnsupportedAudioFileException
IOException
-
get
public static AudioMetaData get(Path file, BasicFileAttributes basicFileAttributes, FileId fileId, boolean lazyRead) throws UnsupportedAudioFileException, IOException
Creates anAudioMetaData
object for the given file if possible. It is the responsibility of the caller to ensure thatfile
andfileId
refer indeed to the same file.- Parameters:
file
- filebasicFileAttributes
- file attributes as they are known at the time of the callfileId
- file idlazyRead
- iftrue
, read data from the file in a lazy fashion- Returns:
AudioMetaData
object- Throws:
UnsupportedAudioFileException
IOException
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener propertyChangeListener) throws UnsupportedOperationException
Description copied from interface:AudioSong
Lets you add a property change listener to this song. This is an optional feature and may lead to exceptions.- Specified by:
addPropertyChangeListener
in interfaceAudioSong
- Parameters:
propertyChangeListener
- property change listener- Throws:
UnsupportedOperationException
- if property changes notifications are not supported- See Also:
PropertyChangeSupport.addPropertyChangeListener(java.beans.PropertyChangeListener)
-
addPropertyChangeListener
public void addPropertyChangeListener(String property, PropertyChangeListener propertyChangeListener) throws UnsupportedOperationException
Description copied from interface:AudioSong
Lets you add a property change listener to this song. This is an optional feature and may lead to exceptions.- Specified by:
addPropertyChangeListener
in interfaceAudioSong
- Parameters:
property
- property namepropertyChangeListener
- property change listener- Throws:
UnsupportedOperationException
- if property changes notifications are not supported- See Also:
PropertyChangeSupport.addPropertyChangeListener(java.beans.PropertyChangeListener)
-
removePropertyChangeListener
public void removePropertyChangeListener(String property, PropertyChangeListener listener)
Description copied from interface:AudioSong
Lets you remove a property change listener to this song. This is an optional feature and may lead to exceptions.- Specified by:
removePropertyChangeListener
in interfaceAudioSong
- Parameters:
property
- property namelistener
- property change listener- See Also:
PropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener)
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Description copied from interface:AudioSong
Lets you remove a property change listener to this song. This is an optional feature and may lead to exceptions.- Specified by:
removePropertyChangeListener
in interfaceAudioSong
- Parameters:
listener
- property change listener- See Also:
PropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener)
-
getPropertyChangeListeners
public PropertyChangeListener[] getPropertyChangeListeners(String property)
- Specified by:
getPropertyChangeListeners
in interfaceAudioSong
- See Also:
PropertyChangeSupport.getPropertyChangeListeners(String)
-
getPropertyChangeListeners
public PropertyChangeListener[] getPropertyChangeListeners()
- Specified by:
getPropertyChangeListeners
in interfaceAudioSong
- See Also:
PropertyChangeSupport.getPropertyChangeListeners()
-
isShared
public boolean isShared()
Description copied from interface:AudioSong
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.
-
setFile
public void setFile(Path file)
-
getFile
public Path getFile(boolean refresh)
Description copied from interface:AudioSong
File of this track. Ifrefresh
is true and the file does not exist anymore, ask the backend app (iTunes, Music.app, ...) for the correct file name. Because of the backend call, this method may block and therefore should be called from the EDT.- Specified by:
getFile
in interfaceAudioSong
- Parameters:
refresh
- refresh from backend- Returns:
- file object for
AudioSong.getLocation()
or null, if a proper file object cannot be formed - See Also:
AudioSong.getLocation()
,AudioSong.getLocation(boolean)
-
getFileId
public FileId getFileId()
-
dump
public String dump()
-
getTag
protected org.jaudiotagger.tag.Tag getTag()
-
dump
public abstract void dump(org.jaudiotagger.tag.TagField tagField, StringBuilder sb)
-
getImplementation
public <T> T getImplementation(Class<T> klass)
Description copied from interface:AudioSong
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. :-)
- Specified by:
getImplementation
in interfaceAudioSong
- 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
public List<AudioSong> getImplementations()
Description copied from interface:AudioSong
Returns implementations of this interface instance.- Specified by:
getImplementations
in interfaceAudioSong
- Returns:
- implementations
- See Also:
AudioSong.getImplementation(Class)
-
getImage
public Image getImage()
Returns an embedded image from the AudioMetaData. Typically this is done by looking up the corresponding tag, i.e. APIC or covr, ... and reading the binary data into an image. For new fileformats, tags, etc. this method has to be overridden.- Specified by:
getImage
in interfaceAudioSong
- Returns:
- image or null, if not found
- Throws:
AudioMetaDataException
- See Also:
AudioSong.getFrontCoverImage()
,AudioSong.getBackCoverImage()
-
getFrontCoverImage
public Image getFrontCoverImage()
Description copied from interface:AudioSong
Returns the first front cover image.- Specified by:
getFrontCoverImage
in interfaceAudioSong
- Returns:
- image or null
-
getBackCoverImage
public Image getBackCoverImage()
Description copied from interface:AudioSong
Returns the first front cover image.- Specified by:
getBackCoverImage
in interfaceAudioSong
- Returns:
- image or null
-
getSpecification
public abstract String getSpecification()
-
getSpecificationVersion
public abstract String getSpecificationVersion()
-
getChannels
public int getChannels()
-
getChannelsAsString
public String getChannelsAsString()
-
getAudioFile
protected org.jaudiotagger.audio.AudioFile getAudioFile()
- Returns:
- audio file - new instance, if it was changed or not loaded yet
- Throws:
AudioMetaDataException
-
refreshFromFile
public void refreshFromFile() throws IOException
Description copied from interface:AudioSong
Attempt to reload data from the underlying file.- Specified by:
refreshFromFile
in interfaceAudioSong
- Throws:
IOException
- if the operation fails- See Also:
AudioSong.getImplementation(Class)
-
getTuneCortexID
public Long getTuneCortexID()
-
setTuneCortexID
public void setTuneCortexID(Long id)
-
getTotalTime
public int getTotalTime()
Description copied from interface:AudioSong
Total length of the song in ms.- Specified by:
getTotalTime
in interfaceAudioSong
- Returns:
- length in ms.
-
getSampleRate
public int getSampleRate()
Description copied from interface:AudioSong
Get sample rate in Hz.- Specified by:
getSampleRate
in interfaceAudioSong
- Returns:
- sample rate in Hz
-
getBitRate
public int getBitRate()
Description copied from interface:AudioSong
Bit rate.- Specified by:
getBitRate
in interfaceAudioSong
- Returns:
- bit rate
-
canWrite
public boolean canWrite()
Description copied from interface:AudioSong
Checks whether the file corresponding to this song can in principal be written to.
-
getArtworks
public AudioArtwork[] getArtworks()
Description copied from interface:AudioSong
Artwork belonging to this song.- Specified by:
getArtworks
in interfaceAudioSong
- Returns:
- array of artworks
-
setArtworks
public void setArtworks(AudioArtwork... audioArtworks)
Description copied from interface:AudioSong
Set artworks belonging to this track.- Specified by:
setArtworks
in interfaceAudioSong
- Parameters:
audioArtworks
- artworks
-
createArtwork
protected static org.jaudiotagger.tag.images.Artwork createArtwork(AudioArtwork audioArtwork)
-
getArtworkCount
public int getArtworkCount()
Description copied from interface:AudioSong
Get artwork count.- Specified by:
getArtworkCount
in interfaceAudioSong
- Returns:
- artwork count
-
setFrontCoverArtwork
public void setFrontCoverArtwork(File... frontCovers)
Description copied from interface:AudioSong
Replace all front covers with the given files.- Specified by:
setFrontCoverArtwork
in interfaceAudioSong
- Parameters:
frontCovers
- front cover- See Also:
AudioSong.setBackCoverArtwork(java.io.File...)
-
setBackCoverArtwork
public void setBackCoverArtwork(File... backCovers)
Description copied from interface:AudioSong
Replace all back covers with the given files.- Specified by:
setBackCoverArtwork
in interfaceAudioSong
- Parameters:
backCovers
- back cover- See Also:
AudioSong.setFrontCoverArtwork(java.io.File...)
-
addArtwork
public void addArtwork(AudioArtwork audioArtwork)
Description copied from interface:AudioSong
Adds an artwork/image to the audio song.- Specified by:
addArtwork
in interfaceAudioSong
- Parameters:
audioArtwork
- artwork
-
setArtwork
public void setArtwork(File f)
-
getComposer
public String getComposer()
Description copied from interface:AudioSong
Get composer(s).- Specified by:
getComposer
in interfaceAudioSong
- Returns:
- composer(s)
-
getContentRating
public String getContentRating()
Description copied from interface:AudioSong
Returns the content rating. E.g., "us-tv|TV-PG|400|" or "us-tv|TV-MA|600|dialogue and sexual content"- Specified by:
getContentRating
in interfaceAudioSong
- Returns:
- content rating
-
getDateAdded
public Date getDateAdded()
Description copied from interface:AudioSong
Get date the song was added to the library.- Specified by:
getDateAdded
in interfaceAudioSong
- Returns:
- date added
-
getDateAnalyzed
public Date getDateAnalyzed()
Description copied from interface:AudioSong
Date the song was last analyzed.- Specified by:
getDateAnalyzed
in interfaceAudioSong
- Returns:
- date analyzed
-
setDateAnalyzed
public void setDateAnalyzed(Date date)
Description copied from interface:AudioSong
Sets the date this song was last analyzed.- Specified by:
setDateAnalyzed
in interfaceAudioSong
- Parameters:
date
- date of last analysis
-
getDateModified
public Date getDateModified()
Description copied from interface:AudioSong
Get date of last modification.- Specified by:
getDateModified
in interfaceAudioSong
- Returns:
- date
-
getDiscCount
public int getDiscCount()
Description copied from interface:AudioSong
Assuming that this song is on a disc that is part of a disc collection, return the number of discs in this collection.- Specified by:
getDiscCount
in interfaceAudioSong
- Returns:
- disc count
-
getDiscNumber
public int getDiscNumber()
Description copied from interface:AudioSong
Get the disc number.- Specified by:
getDiscNumber
in interfaceAudioSong
- Returns:
- disc number
-
getEpisode
public String getEpisode()
Description copied from interface:AudioSong
Get episode name.- Specified by:
getEpisode
in interfaceAudioSong
- Returns:
- episode name
-
getEpisodeOrder
public int getEpisodeOrder()
Description copied from interface:AudioSong
Episode order.- Specified by:
getEpisodeOrder
in interfaceAudioSong
- Returns:
- episode order
-
getFinish
public float getFinish()
Description copied from interface:AudioSong
Stop time of the song in seconds.- Specified by:
getFinish
in interfaceAudioSong
- Returns:
- stop time in seconds.
- See Also:
AudioSong.getStopTime()
-
setGenre
public void setGenre(String genre)
Description copied from interface:AudioSong
Sets genre.
-
getGrouping
public String getGrouping()
Description copied from interface:AudioSong
Get grouping.- Specified by:
getGrouping
in interfaceAudioSong
- Returns:
- grouping
-
getKind
public String getKind()
Description copied from interface:AudioSong
Kind of audio, e.g. "WAV audio file", "AAC audio file" or "MPEG audio file" (or localized versions thereof). This value is typically extracted fromiTunes Music Library.xml
and may simply benull
for non-iTunes libraries.
-
getLocation
public String getLocation(boolean refresh)
Description copied from interface:AudioSong
Location of this track. Ifrefresh
is true and no location is available or the resource does not exist anymore, ask the backend app (iTunes, Music.app, ...) for the correct path. Because of the backend call, this method may block and therefore should be called from the EDT.- Specified by:
getLocation
in interfaceAudioSong
- Parameters:
refresh
- refresh from backend- Returns:
- location
- See Also:
AudioSong.getLocation()
,AudioSong.getFile(boolean)
-
getId
public Long getId()
Description copied from interface:AudioSong
Persistent id. Survives application shutdown.
-
getPath
public String getPath()
Description copied from interface:AudioSong
Path.- Specified by:
getPath
in interfaceAudioSong
- Returns:
- path object for
AudioSong.getLocation()
or null, if a proper file object cannot be formed
-
getPlayDate
public long getPlayDate()
Description copied from interface:AudioSong
Get time the song was last played. Returns0
, if it has never been played.- Specified by:
getPlayDate
in interfaceAudioSong
- Returns:
- play date, milliseconds since January 1, 1970, 00:00:00 GMT (NOT related to the iTunes value!)
-
getPlayDateUTC
public Date getPlayDateUTC()
Description copied from interface:AudioSong
Get play date.- Specified by:
getPlayDateUTC
in interfaceAudioSong
- Returns:
- play date
-
getPlayFrequency
public double getPlayFrequency()
Description copied from interface:AudioSong
Number of times played per 100 days.- Specified by:
getPlayFrequency
in interfaceAudioSong
- Returns:
- played per 100 days
- See Also:
AudioSong.getRemotePlayFrequency()
-
getPlaySkipRatio
public double getPlaySkipRatio()
Description copied from interface:AudioSong
Play/Skip ratio. Defined asplayCount/(skipCount+1)
.- Specified by:
getPlaySkipRatio
in interfaceAudioSong
- Returns:
- playSkip ratio as defined above
- See Also:
AudioSong.getRemotePlaySkipRatio()
,AudioSong.getPopularity()
-
getSeason
public int getSeason()
Description copied from interface:AudioSong
Get season number. Suitable for TV-shows.
-
getShow
public String getShow()
Description copied from interface:AudioSong
Name of a show, suitable for TV shows.
-
getSize
public long getSize()
Description copied from interface:AudioSong
File size.
-
getSkipCount
public int getSkipCount()
Description copied from interface:AudioSong
Get skip count.- Specified by:
getSkipCount
in interfaceAudioSong
- Returns:
- skip count
-
getSkipDate
public Date getSkipDate()
Description copied from interface:AudioSong
Get skip date.- Specified by:
getSkipDate
in interfaceAudioSong
- Returns:
- skip date
-
getSortComposer
public String getSortComposer()
Description copied from interface:AudioSong
Returns the sort composer.- Specified by:
getSortComposer
in interfaceAudioSong
- Returns:
- sort composer
-
getSortShow
public String getSortShow()
Description copied from interface:AudioSong
Returns the sort show.- Specified by:
getSortShow
in interfaceAudioSong
- Returns:
- sort show
-
getStart
public float getStart()
Description copied from interface:AudioSong
Start time of the song in seconds.- Specified by:
getStart
in interfaceAudioSong
- Returns:
- start time in seconds.
- See Also:
AudioSong.getStartTime()
-
getStartTime
public int getStartTime()
Description copied from interface:AudioSong
Start time of the song in ms.- Specified by:
getStartTime
in interfaceAudioSong
- Returns:
- start time in ms.
-
getStopTime
public int getStopTime()
Description copied from interface:AudioSong
Stop time of the song in ms.- Specified by:
getStopTime
in interfaceAudioSong
- Returns:
- stop time in ms.
-
getTrackCount
public int getTrackCount()
Description copied from interface:AudioSong
Number of tracks on album/release/recording.- Specified by:
getTrackCount
in interfaceAudioSong
- Returns:
- track count
- See Also:
AudioSong.getTrackNumber()
-
getTrackNumber
public int getTrackNumber()
Description copied from interface:AudioSong
Get the number of the track on the release/album/recording.- Specified by:
getTrackNumber
in interfaceAudioSong
- Returns:
- track number
-
getTrackType
public AudioSong.TrackType getTrackType()
Description copied from interface:AudioSong
Track type. E.g.AudioSong.TrackType.FILE
.- Specified by:
getTrackType
in interfaceAudioSong
- Returns:
- track type
- See Also:
AudioSong.setTrackType(TrackType)
-
getVolumeAdjustment
public int getVolumeAdjustment()
Description copied from interface:AudioSong
Value between -255 and 255.- Specified by:
getVolumeAdjustment
in interfaceAudioSong
- Returns:
- volume adjustment
-
getYear
public int getYear()
Description copied from interface:AudioSong
Release year - (corresponds to id3 TDRC, recording time).- Specified by:
getYear
in interfaceAudioSong
- Returns:
- four digit recording year, if available
- See Also:
AudioSong.getReleaseDate()
-
hasProtectedFileExtension
public boolean hasProtectedFileExtension()
Description copied from interface:AudioSong
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.- Specified by:
hasProtectedFileExtension
in interfaceAudioSong
- Returns:
- true, if we know that the file-format is usually protected.
-
isAlbumRatingComputed
public boolean isAlbumRatingComputed()
Description copied from interface:AudioSong
Indicates whether the value returned byAudioSong.getAlbumRating()
was computed or set manually.- Specified by:
isAlbumRatingComputed
in interfaceAudioSong
- Returns:
true
orfalse
-
isClean
public boolean isClean()
Description copied from interface:AudioSong
Indicates whether this song is "clean" - whatever that means. "Clean" and "explicit" are mutually exclusive.- Specified by:
isClean
in interfaceAudioSong
- Returns:
true
orfalse
- See Also:
AudioSong.isExplicit()
-
isCompilation
public boolean isCompilation()
Description copied from interface:AudioSong
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- Specified by:
isCompilation
in interfaceAudioSong
- Returns:
true
orfalse
-
setCompilation
public void setCompilation(boolean compilation)
Description copied from interface:AudioSong
Marks this song as part of a compilation (or not).- Specified by:
setCompilation
in interfaceAudioSong
- Parameters:
compilation
-true
orfalse
-
isDisabled
public boolean isDisabled()
Description copied from interface:AudioSong
Indicates whether this song is disabled or unchecked.- Specified by:
isDisabled
in interfaceAudioSong
- Returns:
- !
AudioSong.isEnabled()
-
isEnabled
public boolean isEnabled()
Description copied from interface:AudioSong
Indicates whether this song is enabled or checked.
-
isExplicit
public boolean isExplicit()
Description copied from interface:AudioSong
Indicates whether this tracks is explicit or not. "Clean" and "explicit" are mutually exclusive.- Specified by:
isExplicit
in interfaceAudioSong
- Returns:
true
orfalse
- See Also:
AudioSong.isClean()
-
isHasVideo
public boolean isHasVideo()
Description copied from interface:AudioSong
Indicates whether this track has a video.- Specified by:
isHasVideo
in interfaceAudioSong
- Returns:
true
orfalse
-
isHD
public boolean isHD()
Description copied from interface:AudioSong
Indicates whether this video content is in high definition (HD).
-
setMediaKind
public void setMediaKind(AudioSong.MediaKind kind)
Description copied from interface:AudioSong
Set the kind of media, e.g.AudioSong.MediaKind.AUDIOBOOK
.- Specified by:
setMediaKind
in interfaceAudioSong
- Parameters:
kind
- media kind
-
getMediaKind
public AudioSong.MediaKind getMediaKind()
Description copied from interface:AudioSong
Media kind of this object.- Specified by:
getMediaKind
in interfaceAudioSong
- Returns:
- kind of media
-
isProtected
public boolean isProtected()
Description copied from interface:AudioSong
- Specified by:
isProtected
in interfaceAudioSong
- Returns:
true
orfalse
-
isPurchased
public boolean isPurchased()
Description copied from interface:AudioSong
Indicates whether this song was purchased (via the iTunes store).- Specified by:
isPurchased
in interfaceAudioSong
- Returns:
true
orfalse
-
isRatingComputed
public boolean isRatingComputed()
Description copied from interface:AudioSong
Indicates whether the value returned byAudioSong.getRating()
was computed or set manually.- Specified by:
isRatingComputed
in interfaceAudioSong
- Returns:
true
orfalse
-
isUnplayed
public boolean isUnplayed()
Description copied from interface:AudioSong
Indicates whether this songs has been played at some point.- Specified by:
isUnplayed
in interfaceAudioSong
- Returns:
true
orfalse
-
setClean
public void setClean(boolean clean)
Description copied from interface:AudioSong
Sets the "clean" flag. "Clean" and "explicit" are mutually exclusive.- Specified by:
setClean
in interfaceAudioSong
- Parameters:
clean
-true
orfalse
- See Also:
AudioSong.setExplicit(boolean)
-
setComposer
public void setComposer(String composer)
Description copied from interface:AudioSong
Sets composer.- Specified by:
setComposer
in interfaceAudioSong
- Parameters:
composer
- composer
-
setContentRating
public void setContentRating(String contentRating)
Description copied from interface:AudioSong
Sets the content rating.- Specified by:
setContentRating
in interfaceAudioSong
- Parameters:
contentRating
- content rating
-
setDisabled
public void setDisabled(boolean disabled)
Description copied from interface:AudioSong
Enables/disables this song.- Specified by:
setDisabled
in interfaceAudioSong
- Parameters:
disabled
-true
orfalse
-
setDiscCount
public void setDiscCount(int discCount)
Description copied from interface:AudioSong
Set disc count.- Specified by:
setDiscCount
in interfaceAudioSong
- Parameters:
discCount
- disc count
-
setDiscNumber
public void setDiscNumber(int discNumber)
Description copied from interface:AudioSong
Sets the disc number.- Specified by:
setDiscNumber
in interfaceAudioSong
- Parameters:
discNumber
- disc number
-
getLyrics
public String getLyrics()
Description copied from interface:AudioSong
Returns the lyrics.
-
setLyrics
public void setLyrics(String lyrics)
Description copied from interface:AudioSong
Sets lyrics.
-
getLyricsTermFrequencies
public List<TermFrequency> getLyricsTermFrequencies()
Description copied from interface:AudioSong
Terms in this song's lyrics along with their frequency. All terms are lowercase, regular ASCII punctuation has been removed.- Specified by:
getLyricsTermFrequencies
in interfaceAudioSong
- Returns:
- term frequencies
-
getAlbumRating
public int getAlbumRating()
Description copied from interface:AudioSong
Get album rating.- Specified by:
getAlbumRating
in interfaceAudioSong
- Returns:
- album rating
- See Also:
AudioSong.isAlbumRatingComputed()
-
setRating
public void setRating(int rating)
Description copied from interface:AudioSong
Sets the rating- Specified by:
setRating
in interfaceAudioSong
- Parameters:
rating
- rating between from 0 to 100- See Also:
AudioSong.getRating()
-
setAlbumRating
public void setAlbumRating(int albumRating)
Description copied from interface:AudioSong
Sets album rating.- Specified by:
setAlbumRating
in interfaceAudioSong
- Parameters:
albumRating
- album rating
-
getRating
public int getRating()
Description copied from interface:AudioSong
Value ranging from 0-100, 100 being best.- Specified by:
getRating
in interfaceAudioSong
- Returns:
- rating
- See Also:
AudioSong.isRatingComputed()
,AudioSong.getAlbumRating()
-
isPartOfGaplessAlbum
public boolean isPartOfGaplessAlbum()
Description copied from interface:AudioSong
Indicates whether this songs is part of a gapless album.- Specified by:
isPartOfGaplessAlbum
in interfaceAudioSong
- Returns:
true
orfalse
-
setPartOfGaplessAlbum
public void setPartOfGaplessAlbum(boolean partOfGaplessAlbum)
Description copied from interface:AudioSong
Sets the "gapless album" flag.- Specified by:
setPartOfGaplessAlbum
in interfaceAudioSong
- Parameters:
partOfGaplessAlbum
-true
orfalse
-
setEnabled
public void setEnabled(boolean enabled)
Description copied from interface:AudioSong
Enables/disables this song.- Specified by:
setEnabled
in interfaceAudioSong
- Parameters:
enabled
-true
orfalse
-
setEpisode
public void setEpisode(String episode)
Description copied from interface:AudioSong
Set episode name.- Specified by:
setEpisode
in interfaceAudioSong
- Parameters:
episode
- episode name
-
setEpisodeOrder
public void setEpisodeOrder(int episodeOrder)
Description copied from interface:AudioSong
Set episode order.- Specified by:
setEpisodeOrder
in interfaceAudioSong
- Parameters:
episodeOrder
- episode order
-
setExplicit
public void setExplicit(boolean explicit)
Description copied from interface:AudioSong
Sets the "explicit" flag. "Clean" and "explicit" are mutually exclusive.- Specified by:
setExplicit
in interfaceAudioSong
- Parameters:
explicit
-true
orfalse
- See Also:
AudioSong.setClean(boolean)
-
setFinish
public void setFinish(float finish)
Description copied from interface:AudioSong
Sets the stop time in seconds.- Specified by:
setFinish
in interfaceAudioSong
- Parameters:
finish
- stop time in seconds- See Also:
AudioSong.setStopTime(int)
-
setGrouping
public void setGrouping(String grouping)
Description copied from interface:AudioSong
Sets the grouping.- Specified by:
setGrouping
in interfaceAudioSong
- Parameters:
grouping
- grouping
-
setHasVideo
public void setHasVideo(boolean hasVideo)
Description copied from interface:AudioSong
Sets the "video" flag.- Specified by:
setHasVideo
in interfaceAudioSong
- Parameters:
hasVideo
-true
orfalse
-
setHD
public void setHD(boolean hd)
Description copied from interface:AudioSong
Sets the HD flag.
-
setKind
public void setKind(String kind)
Description copied from interface:AudioSong
Allows you to store a String descriptor of the kind of audio object this is. Typically this value is read-only (withAudioSong.getKind()
) and set by the music player, e.g. iTunes.- Specified by:
setKind
in interfaceAudioSong
- Parameters:
kind
- kind- See Also:
AudioSong.getKind()
-
setLocation
public void setLocation(String location)
Description copied from interface:AudioSong
Sets the location.- Specified by:
setLocation
in interfaceAudioSong
- Parameters:
location
- location
-
setPlayDate
public void setPlayDate(long playDate)
Description copied from interface:AudioSong
Set play date in milliseconds since January 1, 1970, 00:00:00 GMT (NOT related to the iTunes value!).- Specified by:
setPlayDate
in interfaceAudioSong
- Parameters:
playDate
- play date
-
setPlayDateUTC
public void setPlayDateUTC(Date playDateUTC)
Description copied from interface:AudioSong
Set play time.- Specified by:
setPlayDateUTC
in interfaceAudioSong
- Parameters:
playDateUTC
- play time
-
setSeason
public void setSeason(int season)
Description copied from interface:AudioSong
Set season.
-
setShow
public void setShow(String show)
Description copied from interface:AudioSong
Set show name.
-
setSkipCount
public void setSkipCount(int skipCount)
Description copied from interface:AudioSong
Set skip count.- Specified by:
setSkipCount
in interfaceAudioSong
- Parameters:
skipCount
- skip count
-
setSkipDate
public void setSkipDate(Date skipDate)
Description copied from interface:AudioSong
Set skip date.- Specified by:
setSkipDate
in interfaceAudioSong
- Parameters:
skipDate
- skip date
-
setSortComposer
public void setSortComposer(String sortComposer)
Description copied from interface:AudioSong
Sets the sort composer.- Specified by:
setSortComposer
in interfaceAudioSong
- Parameters:
sortComposer
- sort composer
-
setSortShow
public void setSortShow(String sortShow)
Description copied from interface:AudioSong
Sets the sort show.- Specified by:
setSortShow
in interfaceAudioSong
- Parameters:
sortShow
- sort show
-
setStart
public void setStart(float finish)
Description copied from interface:AudioSong
Sets the start time in seconds.- Specified by:
setStart
in interfaceAudioSong
- Parameters:
finish
- start time in seconds- See Also:
AudioSong.setStartTime(int)
-
setStartTime
public void setStartTime(int startTime)
Description copied from interface:AudioSong
Set start time in ms.- Specified by:
setStartTime
in interfaceAudioSong
- Parameters:
startTime
- start time in ms
-
setStopTime
public void setStopTime(int stopTime)
Description copied from interface:AudioSong
Sets stop time.- Specified by:
setStopTime
in interfaceAudioSong
- Parameters:
stopTime
- stop time in ms
-
setTrackCount
public void setTrackCount(int trackCount)
Description copied from interface:AudioSong
Set track count- Specified by:
setTrackCount
in interfaceAudioSong
- Parameters:
trackCount
- track count- See Also:
AudioSong.setTrackNumber(int)
-
setTrackNumber
public void setTrackNumber(int trackNumber)
Description copied from interface:AudioSong
Set the number of this track.- Specified by:
setTrackNumber
in interfaceAudioSong
- Parameters:
trackNumber
- track number
-
setTrackType
public void setTrackType(AudioSong.TrackType trackType)
Description copied from interface:AudioSong
Field used by iTunes - typicallyAudioSong.TrackType.FILE
for files andAudioSong.TrackType.URL
for.. well, guess what?! Typically you don't set this field manually.- Specified by:
setTrackType
in interfaceAudioSong
- Parameters:
trackType
- track type- See Also:
AudioSong.getTrackType()
-
setUnplayed
public void setUnplayed(boolean unplayed)
Description copied from interface:AudioSong
Sets unplayed.- Specified by:
setUnplayed
in interfaceAudioSong
- Parameters:
unplayed
- unplayed
-
setVolumeAdjustment
public void setVolumeAdjustment(int volumeAdjustment)
Description copied from interface:AudioSong
Sets the volume adjustment- Specified by:
setVolumeAdjustment
in interfaceAudioSong
- Parameters:
volumeAdjustment
- value between -255 and 255.
-
setYear
public void setYear(int year)
Description copied from interface:AudioSong
Sets the year.- Specified by:
setYear
in interfaceAudioSong
- Parameters:
year
- year- See Also:
AudioSong.getYear()
,AudioSong.getReleaseDate()
-
getComments
public String getComments()
Description copied from interface:AudioSong
Get comments.- Specified by:
getComments
in interfaceAudioSong
- Returns:
- comments
-
setComments
public void setComments(String comments)
Description copied from interface:AudioSong
Set comments.- Specified by:
setComments
in interfaceAudioSong
- Parameters:
comments
- comments
-
setArtist
public void setArtist(String artist)
Description copied from interface:AudioSong
Sets artist.
-
getAlbumArtist
public String getAlbumArtist()
Description copied from interface:AudioSong
Get album artist.- Specified by:
getAlbumArtist
in interfaceAudioSong
- Returns:
- album artist
-
setAlbumArtist
public void setAlbumArtist(String albumArtist)
Description copied from interface:AudioSong
Sets the album artist.- Specified by:
setAlbumArtist
in interfaceAudioSong
- Parameters:
albumArtist
- album artist
-
getSortArtist
public String getSortArtist()
Description copied from interface:AudioSong
Returns the "sort artist". E.g., for "The Beatles" the sort artist is "Beatles".- Specified by:
getSortArtist
in interfaceAudioSong
- Returns:
- sort artist
-
setSortArtist
public void setSortArtist(String sortArtist)
Description copied from interface:AudioSong
Sets the sort artist.- Specified by:
setSortArtist
in interfaceAudioSong
- Parameters:
sortArtist
- sort artist
-
getSortAlbumArtist
public String getSortAlbumArtist()
Description copied from interface:AudioSong
Returns the "sort album artist". E.g., for "The Beatles" the sort album artist is "Beatles".- Specified by:
getSortAlbumArtist
in interfaceAudioSong
- Returns:
- sort album artist
-
setSortAlbumArtist
public void setSortAlbumArtist(String sortAlbumArtist)
Description copied from interface:AudioSong
Sets the sort album artist.- Specified by:
setSortAlbumArtist
in interfaceAudioSong
- Parameters:
sortAlbumArtist
- sort album artist
-
getSortAlbum
public String getSortAlbum()
Description copied from interface:AudioSong
Returns the "sort album". E.g., for "A Hard Day's Night" the sort album is "Hard Day's Night".- Specified by:
getSortAlbum
in interfaceAudioSong
- Returns:
- sort album
-
setSortAlbum
public void setSortAlbum(String sortAlbum)
Description copied from interface:AudioSong
Sets the sort album.- Specified by:
setSortAlbum
in interfaceAudioSong
- Parameters:
sortAlbum
- sort album
-
setAlbum
public void setAlbum(String album)
Description copied from interface:AudioSong
Sets album name.
-
setMovement
public void setMovement(String movement)
Description copied from interface:AudioSong
Classical movement.- Specified by:
setMovement
in interfaceAudioSong
- Parameters:
movement
- movement
-
getMovement
public String getMovement()
Description copied from interface:AudioSong
Classical movement.- Specified by:
getMovement
in interfaceAudioSong
- Returns:
- movement
-
getMovementNumber
public int getMovementNumber()
Description copied from interface:AudioSong
Classical movement number.- Specified by:
getMovementNumber
in interfaceAudioSong
- Returns:
- movement number
-
setMovementNumber
public void setMovementNumber(int number)
Description copied from interface:AudioSong
Classical movement number.- Specified by:
setMovementNumber
in interfaceAudioSong
- Parameters:
number
- number
-
getMovementCount
public int getMovementCount()
Description copied from interface:AudioSong
Classical movement count.- Specified by:
getMovementCount
in interfaceAudioSong
- Returns:
- count
-
setMovementCount
public void setMovementCount(int count)
Description copied from interface:AudioSong
Classical movement count.- Specified by:
setMovementCount
in interfaceAudioSong
- Parameters:
count
- count
-
setWork
public void setWork(String work)
Description copied from interface:AudioSong
Classical work.
-
setDescription
public void setDescription(String name)
Description copied from interface:AudioSong
Sets description/subtitle.- Specified by:
setDescription
in interfaceAudioSong
- Parameters:
name
- description
-
getDescription
public String getDescription()
Description copied from interface:AudioSong
Description/subtitle of this song.- Specified by:
getDescription
in interfaceAudioSong
- Returns:
- description
-
getSortName
public String getSortName()
Description copied from interface:AudioSong
Returns the "sort name". E.g., for "A Taste of Honey" the sort name is "Taste of Honey".- Specified by:
getSortName
in interfaceAudioSong
- Returns:
- sort name
-
setSortName
public void setSortName(String sortName)
Description copied from interface:AudioSong
Sets the sort name.- Specified by:
setSortName
in interfaceAudioSong
- Parameters:
sortName
- sort name
-
getCustom1
public String getCustom1()
Description copied from interface:AudioSong
Custom field.- Specified by:
getCustom1
in interfaceAudioSong
- Returns:
- custom field
-
setCustom1
public void setCustom1(String value)
Description copied from interface:AudioSong
Custom field.- Specified by:
setCustom1
in interfaceAudioSong
- Parameters:
value
- custom field value
-
getCustom2
public String getCustom2()
Description copied from interface:AudioSong
Custom field.- Specified by:
getCustom2
in interfaceAudioSong
- Returns:
- custom field
-
setCustom2
public void setCustom2(String value)
Description copied from interface:AudioSong
Custom field.- Specified by:
setCustom2
in interfaceAudioSong
- Parameters:
value
- custom field value
-
getCustom3
public String getCustom3()
Description copied from interface:AudioSong
Custom field.- Specified by:
getCustom3
in interfaceAudioSong
- Returns:
- custom field
-
setCustom3
public void setCustom3(String value)
Description copied from interface:AudioSong
Custom field.- Specified by:
setCustom3
in interfaceAudioSong
- Parameters:
value
- custom field value
-
getCustom4
public String getCustom4()
Description copied from interface:AudioSong
Custom field.- Specified by:
getCustom4
in interfaceAudioSong
- Returns:
- custom field
-
setCustom4
public void setCustom4(String value)
Description copied from interface:AudioSong
Custom field.- Specified by:
setCustom4
in interfaceAudioSong
- Parameters:
value
- custom field value
-
getCustom5
public String getCustom5()
Description copied from interface:AudioSong
Custom field.- Specified by:
getCustom5
in interfaceAudioSong
- Returns:
- custom field
-
setCustom5
public void setCustom5(String value)
Description copied from interface:AudioSong
Custom field.- Specified by:
setCustom5
in interfaceAudioSong
- Parameters:
value
- custom field value
-
setMoodKeywords
public void setMoodKeywords(Set<String> moodKeywords)
Description copied from interface:AudioSong
Attempt to store the raw mood keywords- Specified by:
setMoodKeywords
in interfaceAudioSong
- Parameters:
moodKeywords
- mood keywords
-
getMoodKeywords
public Set<String> getMoodKeywords()
Description copied from interface:AudioSong
Get raw mood keywords.- Specified by:
getMoodKeywords
in interfaceAudioSong
- Returns:
- mood keywords
-
setISRC
public void setISRC(String isrc)
-
getISRC
public String getISRC()
-
setASIN
public void setASIN(String asin)
-
getASIN
public String getASIN()
-
getBarcode
public String getBarcode()
-
setBarcode
public void setBarcode(String barcode)
-
getWikipediaReleaseURL
public String getWikipediaReleaseURL()
-
setWikipediaReleaseURL
public void setWikipediaReleaseURL(String url)
-
getWikipediaArtistURL
public String getWikipediaArtistURL()
-
setWikipediaArtistURL
public void setWikipediaArtistURL(String url)
-
getDiscogsArtistURL
public String getDiscogsArtistURL()
-
setDiscogsArtistURL
public void setDiscogsArtistURL(String url)
-
getDiscogsReleaseURL
public String getDiscogsReleaseURL()
-
setDiscogsReleaseURL
public void setDiscogsReleaseURL(String url)
-
getOfficialArtistURL
public String getOfficialArtistURL()
-
setOfficialArtistURL
public void setOfficialArtistURL(String url)
-
getOfficialReleaseURL
public String getOfficialReleaseURL()
-
setOfficialReleaseURL
public void setOfficialReleaseURL(String url)
-
setMusicIPPUID
public void setMusicIPPUID(String puid)
-
getMusicIPPUID
public String getMusicIPPUID()
-
setMusicBrainzArtistId
public void setMusicBrainzArtistId(String id)
-
getMusicBrainzArtistId
public String getMusicBrainzArtistId()
-
setMusicBrainzAlbumArtistId
public void setMusicBrainzAlbumArtistId(String id)
-
getMusicBrainzAlbumArtistId
public String getMusicBrainzAlbumArtistId()
-
setMusicBrainzAlbumId
public void setMusicBrainzAlbumId(String id)
-
getMusicBrainzAlbumId
public String getMusicBrainzAlbumId()
-
getMusicBrainzReleaseGroupId
public String getMusicBrainzReleaseGroupId()
-
setMusicBrainzReleaseGroupId
public void setMusicBrainzReleaseGroupId(String id)
-
setMusicBrainzTrackId
public void setMusicBrainzTrackId(String id)
-
getMusicBrainzTrackId
public String getMusicBrainzTrackId()
-
getBeatportTrackId
public String getBeatportTrackId()
-
setYouTubeURL
public void setYouTubeURL(String url)
-
getYouTubeURL
public String getYouTubeURL()
-
getTrackIds
public Set<AudioId> getTrackIds()
Description copied from interface:AudioSong
Returns track ids.- Specified by:
getTrackIds
in interfaceAudioSong
- Returns:
- track ids
-
getAlbumIds
public Set<AudioId> getAlbumIds()
Description copied from interface:AudioSong
Get album ids.- Specified by:
getAlbumIds
in interfaceAudioSong
- Returns:
- album ids
-
getArtistIds
public Set<AudioId> getArtistIds()
Description copied from interface:AudioSong
Get artists ids.- Specified by:
getArtistIds
in interfaceAudioSong
- Returns:
- artist ids
-
getLanguage
public String getLanguage()
Description copied from interface:AudioSong
The language of the lyrics as ISO 639 three letter codes.- Specified by:
getLanguage
in interfaceAudioSong
- Returns:
- ISO 639 three letter language code
-
setLanguage
public void setLanguage(String threeCharLanguageCode)
Description copied from interface:AudioSong
Sets the language as ISO 639 three letter code.- Specified by:
setLanguage
in interfaceAudioSong
- Parameters:
threeCharLanguageCode
- ISO 639 three letter code
-
getEncoder
public String getEncoder()
-
getKey
public Key getKey()
Description copied from interface:AudioSong
Return the tonal key of this song. E.g.,MajorKey.C_MAJOR
.
-
setKey
public void setKey(Key key)
Description copied from interface:AudioSong
Sets the tonal key.- Specified by:
setKey
in interfaceAudioSong
- Parameters:
key
- tonal key key- See Also:
AudioSong.setKeyAlgorithm(String)
-
setKey
public void setKey(String key)
Allows writing the key value in some custom format (NOT RECOMMENDED!!).- Parameters:
key
- key
-
setTag
protected void setTag(org.jaudiotagger.tag.FieldKey key, String value)
-
setTags
protected void setTags(org.jaudiotagger.tag.FieldKey key, String[] values)
-
getFingerprint
public byte[] getFingerprint()
Returns beaTunes fingerprint.- Specified by:
getFingerprint
in interfaceAudioSong
- Returns:
- acoustic fingerprint
-
setFingerprint
public void setFingerprint(byte[] fingerprint)
Writes a beaTunes fingerprint- Specified by:
setFingerprint
in interfaceAudioSong
- Parameters:
fingerprint
- fingerprint
-
isTransactional
public boolean isTransactional()
Indicates whether this object behaves transactionally.- Returns:
- true or false
-
isDirty
public boolean isDirty()
Indicates whether we are in a transaction and the object has been changed, but not written yet.- Returns:
- true or false
-
beginTransaction
public void beginTransaction() throws IOException
Makes this AudioMetaData object transactional - i.e. any modifications are only written, once the user callscommit()
.- Throws:
IOException
- See Also:
commit()
-
beginTransaction
public void beginTransaction(boolean readFresh) throws IOException
Makes this AudioMetaData object transactional - i.e. any modifications are only written, once the user callscommit()
.- Parameters:
readFresh
- re-read the underlying object at the beginning of the transaction- Throws:
IOException
- See Also:
commit()
-
commit
public void commit() throws IOException
Writes all changes to disk.- Throws:
IOException
- See Also:
beginTransaction()
,rollback()
-
commit
public void commit(boolean detectConcurrentModification) throws IOException
Writes all changes to disk.- Parameters:
detectConcurrentModification
- throw IOException if the file was manipulated externally- Throws:
IOException
- See Also:
beginTransaction()
,rollback()
-
rollback
public void rollback() throws IOException
Reads the underlying data fresh from disk- Throws:
IOException
- See Also:
commit()
-
autoCommit
protected void autoCommit() throws IOException
Called by all the setters to commit, should we not be transactional.- Throws:
IOException
-
getMeasuresPerMinute
public float getMeasuresPerMinute()
Description copied from interface:AudioSong
Measures (bars) per minute. This value is computed fromAudioSong.getBeatsPerMinute()
andAudioSong.getTimeSignature()
. In essence BPM is divided by meter (time signature) numerator.- Specified by:
getMeasuresPerMinute
in interfaceAudioSong
- Returns:
- measures/bars per minute or zero, if either the time signature or the BPM is not known
-
download
public void download()
Description copied from interface:AudioSong
Allows downloading of shared (e.g. podcasts) or iCloud tracks. May not be available on Windows.
You may be notified of a change in download status of a track by registering a
PropertyChangeListener
for one of the propertiesshared
,trackType
orlocation
.- Specified by:
download
in interfaceAudioSong
- See Also:
AudioSong.isShared()
,AudioSong.getTrackType()
,AudioSong.getCloudStatus()
-
getCloudStatus
public AudioSong.CloudStatus getCloudStatus()
Description copied from interface:AudioSong
Returns the cloud status, if available. Note that this call may be expensive, as it requires calling the iTunes API.- Specified by:
getCloudStatus
in interfaceAudioSong
- Returns:
- the status if available,
null
, if the feature is not supported (Windows, non-iTunes libraries, ...)
-
getLiking
public AudioSong.Liking getLiking()
Description copied from interface:AudioSong
Liking. This is an expression of iTunes' loved and disliked fields.
-
setLiking
public void setLiking(AudioSong.Liking liking)
Description copied from interface:AudioSong
Set liking.
-
getAlbumLiking
public AudioSong.Liking getAlbumLiking()
Description copied from interface:AudioSong
Is album liked. This is an expression of iTunes' album loved and album disliked fields.- Specified by:
getAlbumLiking
in interfaceAudioSong
- Returns:
- liking
-
setAlbumLiking
public void setAlbumLiking(AudioSong.Liking liking)
Description copied from interface:AudioSong
Set album liking.- Specified by:
setAlbumLiking
in interfaceAudioSong
- Parameters:
liking
- liking
-
getDanceability
public Float getDanceability()
Description copied from interface:AudioSong
Danceability.- Specified by:
getDanceability
in interfaceAudioSong
- Returns:
- normalized positive value (0-1)
-
setDanceability
public void setDanceability(Float danceability)
Description copied from interface:AudioSong
Danceability.- Specified by:
setDanceability
in interfaceAudioSong
- Parameters:
danceability
- normalized positive value (0-1)
-
getInstrumentation
public AudioSong.Instrumentation getInstrumentation()
Description copied from interface:AudioSong
Indicates whether this song qualifies as "electronic" or "acoustic".- Specified by:
getInstrumentation
in interfaceAudioSong
- Returns:
- instrumentation
-
setInstrumentation
public void setInstrumentation(AudioSong.Instrumentation instrumentation)
Description copied from interface:AudioSong
Sets the instrumentation property.- Specified by:
setInstrumentation
in interfaceAudioSong
- Parameters:
instrumentation
- instrumentation
-
getUniqueURLFrame
protected String getUniqueURLFrame(String name)
Sets a value as url frame, replacing any url frame with the same name/description. As example, in the context of ID3, this is aWXXX
frame.- Parameters:
name
- name- Returns:
- URL
- See Also:
getUniqueURLFrame(String)
,getUniqueTextFrame(String)
-
setUniqueURLFrame
protected void setUniqueURLFrame(String name, String url)
Gets a unique URL frame.- Parameters:
name
- name/descriptionurl
- URL- See Also:
setUniqueURLFrame(String, String)
,setUniqueTextFrame(String, String)
-
setUniqueTextFrame
protected abstract void setUniqueTextFrame(String name, String value)
Sets a value as text frame, replacing any text frame with the same name/description. As example, in the context of ID3, this is aTXXX
frame.- Parameters:
name
- namevalue
- value- See Also:
getUniqueTextFrame(String)
,getUniqueURLFrame(String)
-
getUniqueTextFrame
protected abstract String getUniqueTextFrame(String name)
Gets a unique text frame.- Parameters:
name
- name/description- Returns:
- value
- See Also:
setUniqueURLFrame(String, String)
,setUniqueTextFrame(String, String)
-
getUniqueLongTextFrame
protected long getUniqueLongTextFrame(String key)
-
setTuning
public void setTuning(Integer tuning)
Description copied from interface:AudioSong
Sets tuning in cents (+-50).
-
getBeatsPerMinuteAlgorithm
public String getBeatsPerMinuteAlgorithm()
Description copied from interface:AudioSong
Returns the name of the algorithm used to determine the beats per minute (BPM).- Specified by:
getBeatsPerMinuteAlgorithm
in interfaceAudioSong
- Returns:
- algorithm name
-
getKeyAlgorithm
public String getKeyAlgorithm()
Description copied from interface:AudioSong
Returns the name of the key algorithm. May beEntered
, if the key value was entered.- Specified by:
getKeyAlgorithm
in interfaceAudioSong
- Returns:
- key algorithm
-
getInstrumentationAlgorithm
public String getInstrumentationAlgorithm()
Description copied from interface:AudioSong
Returns the name of the instrumentation algorithm. May beEntered
, if the value was entered.- Specified by:
getInstrumentationAlgorithm
in interfaceAudioSong
- Returns:
- instrumentation algorithm
-
getDanceabilityAlgorithm
public String getDanceabilityAlgorithm()
Description copied from interface:AudioSong
Returns the name of the danceability algorithm. May beEntered
, if the value was entered.- Specified by:
getDanceabilityAlgorithm
in interfaceAudioSong
- Returns:
- danceability algorithm
-
setBeatsPerMinuteAlgorithm
public void setBeatsPerMinuteAlgorithm(String bpmAlgorithm)
Description copied from interface:AudioSong
Sets the BPM algorithm.- Specified by:
setBeatsPerMinuteAlgorithm
in interfaceAudioSong
- Parameters:
bpmAlgorithm
- bpm algorithm name
-
setKeyAlgorithm
public void setKeyAlgorithm(String keyAlgorithm)
Description copied from interface:AudioSong
Set the key algorithm. Should beEntered
, if the value was entered manually.- Specified by:
setKeyAlgorithm
in interfaceAudioSong
- Parameters:
keyAlgorithm
- key algorithm
-
setInstrumentationAlgorithm
public void setInstrumentationAlgorithm(String instrumentationAlgorithm)
Description copied from interface:AudioSong
Set the instrumentation algorithm. Should beEntered
, if the value was entered manually.- Specified by:
setInstrumentationAlgorithm
in interfaceAudioSong
- Parameters:
instrumentationAlgorithm
- instrumentation algorithm
-
setDanceabilityAlgorithm
public void setDanceabilityAlgorithm(String danceabilityAlgorithm)
Description copied from interface:AudioSong
Set the danceability algorithm. Should beEntered
, if the value was entered manually.- Specified by:
setDanceabilityAlgorithm
in interfaceAudioSong
- Parameters:
danceabilityAlgorithm
- danceability algorithm
-
getTuningAlgorithm
public String getTuningAlgorithm()
Description copied from interface:AudioSong
The method the current tuning was created with.- Specified by:
getTuningAlgorithm
in interfaceAudioSong
- Returns:
- tuning algorithm
-
setTuningAlgorithm
public void setTuningAlgorithm(String tuningAlgorithm)
Description copied from interface:AudioSong
Sets the tuning algorithm the current tuning value was computed with.- Specified by:
setTuningAlgorithm
in interfaceAudioSong
- Parameters:
tuningAlgorithm
- tuning algorithm
-
setRelativeSpectralEntropyMean
public void setRelativeSpectralEntropyMean(Float average)
Description copied from interface:AudioSong
Sets the average relative spectral entropy.- Specified by:
setRelativeSpectralEntropyMean
in interfaceAudioSong
- Parameters:
average
- average- See Also:
AudioSong.getRelativeSpectralEntropyMean()
-
getRelativeSpectralEntropyMean
public Float getRelativeSpectralEntropyMean()
Description copied from interface:AudioSong
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.- Specified by:
getRelativeSpectralEntropyMean
in interfaceAudioSong
- Returns:
- average relative entropy
- See Also:
AggregateFunctions.RELATIVE_ENTROPY
,SpectralFeaturePipelines.createAverageRelativeSpectralEntropyPipeline(String, int, int, int)
-
setSpectralSpreadMean
public void setSpectralSpreadMean(Float average)
Description copied from interface:AudioSong
Sets the average spectral spread.- Specified by:
setSpectralSpreadMean
in interfaceAudioSong
- Parameters:
average
- average spectral spread- See Also:
AudioSong.getSpectralSpreadMean()
-
getSpectralSpreadMean
public Float getSpectralSpreadMean()
Description copied from interface:AudioSong
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.- Specified by:
getSpectralSpreadMean
in interfaceAudioSong
- Returns:
- average spectral spread
- See Also:
SpectralFeaturePipelines.createAverageSpectralSpreadPipeline(String, int, int, int)
-
setSpectralCentroidMean
public void setSpectralCentroidMean(Float average)
Description copied from interface:AudioSong
Sets the mean of the spectral centroids.- Specified by:
setSpectralCentroidMean
in interfaceAudioSong
- Parameters:
average
- averaged spectral centroids- See Also:
AudioSong.getSpectralCentroidMean()
-
getSpectralCentroidMean
public Float getSpectralCentroidMean()
Description copied from interface:AudioSong
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.- Specified by:
getSpectralCentroidMean
in interfaceAudioSong
- Returns:
- averaged spectral centroid
- See Also:
SpectralFeaturePipelines.createAverageSpectralCentroidPipeline(String, int, int, int)
-
setRMSStandardDeviation
public void setRMSStandardDeviation(Float standardDeviation)
Description copied from interface:AudioSong
Sets the standard deviation of the root mean square (RMS).- Specified by:
setRMSStandardDeviation
in interfaceAudioSong
- Parameters:
standardDeviation
- standard deviation of the RMS/window
-
getRMSStandardDeviation
public Float getRMSStandardDeviation()
Description copied from interface:AudioSong
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.- Specified by:
getRMSStandardDeviation
in interfaceAudioSong
- Returns:
- standard deviation of the RMS for the first 120 seconds
- See Also:
Floats.rootMeanSquare(float[])
,AudioSong.getRMSMean()
-
setRMSMean
public void setRMSMean(Float average)
Description copied from interface:AudioSong
Sets the average RMS for the first 120 seconds of this song.- Specified by:
setRMSMean
in interfaceAudioSong
- Parameters:
average
- averaged RMS- See Also:
AudioSong.getRMSMean()
-
getRMSMean
public Float getRMSMean()
Description copied from interface:AudioSong
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.- Specified by:
getRMSMean
in interfaceAudioSong
- Returns:
- average RMS for the first 120 seconds
- See Also:
TemporalFeaturePipelines.createAverageRootMeanSquarePipeline(String, int, int)
,Floats.rootMeanSquare(float[])
,AudioSong.getRMSStandardDeviation()
-
setSpectralNoveltyMean
public void setSpectralNoveltyMean(Float average)
Description copied from interface:AudioSong
Sets the average spectral novelty.- Specified by:
setSpectralNoveltyMean
in interfaceAudioSong
- Parameters:
average
- average- See Also:
AudioSong.getSpectralNoveltyMean()
-
getSpectralNoveltyMean
public Float getSpectralNoveltyMean()
Description copied from interface:AudioSong
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.- Specified by:
getSpectralNoveltyMean
in interfaceAudioSong
- Returns:
- average spectral novelty
-
setSpectralFluctuationPeak
public void setSpectralFluctuationPeak(Float peak)
Description copied from interface:AudioSong
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.- Specified by:
setSpectralFluctuationPeak
in interfaceAudioSong
- Parameters:
peak
- peak in an averaged fluctuation spectrum- See Also:
AudioSong.getSpectralFluctuationPeak()
-
getSpectralFluctuationPeak
public Float getSpectralFluctuationPeak()
Description copied from interface:AudioSong
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.- Specified by:
getSpectralFluctuationPeak
in interfaceAudioSong
- Returns:
- peak of an averaged fluctuation spectrum
- See Also:
SpectralFeaturePipelines.createAverageSpectralFluctuationPipeline(String, int)
-
getSpectralFluxMean
public Float getSpectralFluxMean()
Description copied from interface:AudioSong
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.- Specified by:
getSpectralFluxMean
in interfaceAudioSong
- Returns:
- average spectral flux
- See Also:
SpectralFeaturePipelines.createAverageSpectralFluxPipeline(String, int, int, int)
-
getSpectralVariabilityMean
public Float getSpectralVariabilityMean()
Description copied from interface:AudioSong
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.- Specified by:
getSpectralVariabilityMean
in interfaceAudioSong
- Returns:
- average spectral variability
- See Also:
SpectralFeaturePipelines.createAverageSpectralVariabilityPipeline(String, int, int, int)
-
setSpectralFluxMean
public void setSpectralFluxMean(Float flux)
Description copied from interface:AudioSong
Sets the mean spectral flux.- Specified by:
setSpectralFluxMean
in interfaceAudioSong
- Parameters:
flux
- average spectral flux- See Also:
AudioSong.getSpectralFluxMean()
-
setSpectralVariabilityMean
public void setSpectralVariabilityMean(Float variability)
Description copied from interface:AudioSong
Sets the mean spectral variability.- Specified by:
setSpectralVariabilityMean
in interfaceAudioSong
- Parameters:
variability
- average spectral variability- See Also:
AudioSong.getSpectralVariabilityMean()
-
getMoodAlgorithm
public String getMoodAlgorithm()
Description copied from interface:AudioSong
The method the associated mood value was created with.- Specified by:
getMoodAlgorithm
in interfaceAudioSong
- Returns:
- mood algorithm
-
setMoodAlgorithm
public void setMoodAlgorithm(String moodAlgorithm)
Description copied from interface:AudioSong
Sets the method the current mood value was created with.- Specified by:
setMoodAlgorithm
in interfaceAudioSong
- Parameters:
moodAlgorithm
- mood algorithm
-
getBeatsAlgorithm
public String getBeatsAlgorithm()
Description copied from interface:AudioSong
Method the beats were computed with.- Specified by:
getBeatsAlgorithm
in interfaceAudioSong
- Returns:
- algorithm the beats were computed with
-
setBeatsAlgorithm
public void setBeatsAlgorithm(String beatsAlgorithm)
Description copied from interface:AudioSong
Sets the algorithm the beats were computed with.- Specified by:
setBeatsAlgorithm
in interfaceAudioSong
- Parameters:
beatsAlgorithm
- beats algorithm
-
setSimilaritiesAlgorithm
public void setSimilaritiesAlgorithm(String similaritiesAlgorithm)
Description copied from interface:AudioSong
Sets the algorithm the similarities were computed with.- Specified by:
setSimilaritiesAlgorithm
in interfaceAudioSong
- Parameters:
similaritiesAlgorithm
- similarities algorithm
-
getSimilaritiesAlgorithm
public String getSimilaritiesAlgorithm()
Description copied from interface:AudioSong
Method the similarities were computed with.- Specified by:
getSimilaritiesAlgorithm
in interfaceAudioSong
- Returns:
- algorithm the similarities were computed with
-
getTimeSignatureAlgorithm
public String getTimeSignatureAlgorithm()
Description copied from interface:AudioSong
Method the time signature was computed with.- Specified by:
getTimeSignatureAlgorithm
in interfaceAudioSong
- Returns:
- algorithm the time signature was computed with
-
setTimeSignatureAlgorithm
public void setTimeSignatureAlgorithm(String timeSignatureAlgorithm)
Description copied from interface:AudioSong
Sets the algorithm the time signature was computed with.- Specified by:
setTimeSignatureAlgorithm
in interfaceAudioSong
- Parameters:
timeSignatureAlgorithm
- time signature algorithm
-
setSegmentsAlgorithm
public void setSegmentsAlgorithm(String segmentsAlgorithm)
Description copied from interface:AudioSong
Sets the algorithm the segments were computed with.- Specified by:
setSegmentsAlgorithm
in interfaceAudioSong
- Parameters:
segmentsAlgorithm
- segments algorithm
-
getSegmentsAlgorithm
public String getSegmentsAlgorithm()
Description copied from interface:AudioSong
Method the segments were computed with.- Specified by:
getSegmentsAlgorithm
in interfaceAudioSong
- Returns:
- algorithm the segments were computed with
-
setMood
public void setMood(Mood mood)
Description copied from interface:AudioSong
Sets this song's mood.
-
setTimeSignature
public void setTimeSignature(TimeSignature timeSignature)
Description copied from interface:AudioSong
Sets this song's time signature.- Specified by:
setTimeSignature
in interfaceAudioSong
- Parameters:
timeSignature
- time signature
-
getTimeSignature
public TimeSignature getTimeSignature()
Description copied from interface:AudioSong
The song's time signature.- Specified by:
getTimeSignature
in interfaceAudioSong
- Returns:
- time signature
-
setBeats
public void setBeats(Beats beats)
Description copied from interface:AudioSong
Sets this song's beats.
-
setSimilarities
public void setSimilarities(Similarities similarities)
Description copied from interface:AudioSong
Sets this song's similarities.- Specified by:
setSimilarities
in interfaceAudioSong
- Parameters:
similarities
- similarities
-
getSimilarities
public Similarities getSimilarities()
Description copied from interface:AudioSong
The song's similarities.- Specified by:
getSimilarities
in interfaceAudioSong
- Returns:
- similarities
-
setSegments
public void setSegments(Segments segments)
Description copied from interface:AudioSong
Sets this song's segments.- Specified by:
setSegments
in interfaceAudioSong
- Parameters:
segments
- segments
-
getSegments
public Segments getSegments()
Description copied from interface:AudioSong
The song's segments.- Specified by:
getSegments
in interfaceAudioSong
- Returns:
- segments
-
getLoudness
public Loudness getLoudness()
Description copied from interface:AudioSong
The song's loudness curve.- Specified by:
getLoudness
in interfaceAudioSong
- Returns:
- loudness
-
setLoudness
public void setLoudness(Loudness loudness)
Description copied from interface:AudioSong
Sets this song's loudness curve.- Specified by:
setLoudness
in interfaceAudioSong
-
setColor
public void setColor(Color color)
Description copied from interface:AudioSong
Sets the color.
-
setTempoColor
public void setTempoColor(Color color)
Description copied from interface:AudioSong
Sets this song's tempo color.- Specified by:
setTempoColor
in interfaceAudioSong
- Parameters:
color
- color
-
getTempoColor
public Color getTempoColor()
Description copied from interface:AudioSong
Projection ofAudioSong.getTempoSpectrum()
to a color.- Specified by:
getTempoColor
in interfaceAudioSong
- Returns:
- color or null
-
setTempoTimbreColor
public void setTempoTimbreColor(Color color)
Description copied from interface:AudioSong
Sets this song's tempo-timbre color.- Specified by:
setTempoTimbreColor
in interfaceAudioSong
- Parameters:
color
- color
-
getTempoTimbreColor
public Color getTempoTimbreColor()
Description copied from interface:AudioSong
Projection ofAudioSong.getTempoSpectrum()
andAudioSong.getSpectrum()
to a color.- Specified by:
getTempoTimbreColor
in interfaceAudioSong
- Returns:
- color or null
-
setSpectrum
public void setSpectrum(com.tagtraum.audiokern.timbre.BarkSpectrum spectrum)
Description copied from interface:AudioSong
Sets the bark spectrum.- Specified by:
setSpectrum
in interfaceAudioSong
- Parameters:
spectrum
- bark spectrum
-
getSpectrum
public com.tagtraum.audiokern.timbre.BarkSpectrum getSpectrum()
Description copied from interface:AudioSong
Returns the bark spectrum.- Specified by:
getSpectrum
in interfaceAudioSong
- Returns:
- bark spectrum
- See Also:
AudioSong.getTempoTimbreColor()
-
getTempoSpectrum
public com.tagtraum.audiokern.bpm.TempoSpectrum getTempoSpectrum()
Description copied from interface:AudioSong
Returns the tempo spectrum.- Specified by:
getTempoSpectrum
in interfaceAudioSong
- Returns:
- tempo spectrum
- See Also:
AudioSong.getTempoColor()
,AudioSong.getTempoTimbreColor()
-
setTempoSpectrum
public void setTempoSpectrum(com.tagtraum.audiokern.bpm.TempoSpectrum spectrum)
Description copied from interface:AudioSong
Sets the tempo spectrum.- Specified by:
setTempoSpectrum
in interfaceAudioSong
- Parameters:
spectrum
- tempo spectrum
-
getTags
public Set<String> getTags()
Description copied from interface:AudioSong
Returns a set of tags associated with this song. To manipulate this song's tag, please useAudioSong.setTags(java.util.Set)
and don't manipulate the returned set.
-
setTags
public void setTags(Set<String> tags)
Description copied from interface:AudioSong
Sets a new set of tags.
-
setBeatsPerMinute
public void setBeatsPerMinute(float fBPM)
Description copied from interface:AudioSong
Sets beats per minute.- Specified by:
setBeatsPerMinute
in interfaceAudioSong
- Parameters:
fBPM
- beats per minute- See Also:
AudioSong.setTempo(com.tagtraum.audiokern.bpm.Tempo)
-
getBeatsPerMinute
public float getBeatsPerMinute()
Description copied from interface:AudioSong
Beats per minute (BPM).- Specified by:
getBeatsPerMinute
in interfaceAudioSong
- Returns:
- beats per minute
- See Also:
AudioSong.getTempo()
-
getTempo
public com.tagtraum.audiokern.bpm.Tempo getTempo()
Description copied from interface:AudioSong
Returns tempo.
-
setTempo
public void setTempo(com.tagtraum.audiokern.bpm.Tempo tempo)
Description copied from interface:AudioSong
Sets the tempo.
-
getITunNORM
protected abstract com.tagtraum.audiokern.audiometadata.ITunNORM getITunNORM()
-
setITunNORM
protected abstract void setITunNORM(com.tagtraum.audiokern.audiometadata.ITunNORM iTunNORM)
-
getTrackReplayGain
public ReplayGain getTrackReplayGain()
Description copied from interface:AudioSong
Replay gain for this track (not taking other tracks in an album into account).- Specified by:
getTrackReplayGain
in interfaceAudioSong
- Returns:
- replay gain
- See Also:
- "Radio" replay gain
-
setTrackReplayGain
public void setTrackReplayGain(ReplayGain replayGain, boolean updateITunNorm)
Description copied from interface:AudioSong
Sets the replay gain for this track, not taking other tracks of the album into account.- Specified by:
setTrackReplayGain
in interfaceAudioSong
- Parameters:
replayGain
- replay gainupdateITunNorm
- update the iTunNorm field with the given value- See Also:
AudioSong.getTrackReplayGain()
,AudioSong.getAlbumReplayGain()
-
setAlbumReplayGain
public void setAlbumReplayGain(ReplayGain replayGain, boolean updateITunNorm)
Description copied from interface:AudioSong
Sets the replay gain for this album.- Specified by:
setAlbumReplayGain
in interfaceAudioSong
- Parameters:
replayGain
- replay gainupdateITunNorm
- update the iTunNorm field with the given value- See Also:
AudioSong.getAlbumReplayGain()
-
getAlbumReplayGain
public ReplayGain getAlbumReplayGain()
Description copied from interface:AudioSong
Replay gain for this album.- Specified by:
getAlbumReplayGain
in interfaceAudioSong
- Returns:
- replay gain
- See Also:
- "Audiophile" replay gain,
AudioSong.getTrackReplayGain()
-
getTrackReplayGainFromITunNORM
protected ReplayGain getTrackReplayGainFromITunNORM()
-
main
public static void main(String[] args) throws UnsupportedAudioFileException, IOException
-
getExecutorService
public static ExecutorService getExecutorService()
SpecialExecutorService
for synchronizing access to audiometadata resources. This service is single-threaded.Note that the simpler methods like
ExecutorService.submit(Runnable)
,Executor.execute(Runnable)
orExecutorService.submit(Callable)
execute runnables and callables out of order, if you are already in the executor's thread. In other words, typically tasks are queued (i.e. executed in order), but when you are already in the executor thread, your task is executed right away (i.e. executed out of order).- Returns:
- executor service
-
-