taglib-api-0.1.1.0: An FFI layer over TagLib's C bindings

Safe HaskellSafe-Inferred

Audio.TagLib

Synopsis

Documentation

taglib :: TagLib a -> IO aSource

Run a TagLib block. Save and free any files left open when the block is finished, and free all strings produced by taglib.

io :: IO a -> TagLib aSource

Embed an IO action in the TagLib context.

openFile :: FilePath -> TagLib FileIdSource

Open a file and return a corresponding FileId. Internally, this grabs the Tag and AudioProperties pointers to the TagLib_File.

newtype TagLib a Source

Monad for performing TagLib operations

Constructors

TagLib 

Fields

unTagLib :: StateT TagLibEnv IO a
 

getTitle :: FileId -> TagLib TextSource

Get the track title.

setTitle :: FileId -> Text -> TagLib ()Source

Set the track title.

getArtist :: FileId -> TagLib TextSource

Get the artist name.

setArtist :: FileId -> Text -> TagLib ()Source

Set the artist name.

getAlbum :: FileId -> TagLib TextSource

Get the album name.

setAlbum :: FileId -> Text -> TagLib ()Source

Set the album name.

getComment :: FileId -> TagLib TextSource

Get the contents of the comment field.

setComment :: FileId -> Text -> TagLib ()Source

Set the comment field.

getGenre :: FileId -> TagLib TextSource

Get the contents of the genre field.

setGenre :: FileId -> Text -> TagLib ()Source

Set the genre field.

getYear :: FileId -> TagLib IntSource

Get the release year.

setYear :: FileId -> Int -> TagLib ()Source

Set the release year.

getTrack :: FileId -> TagLib IntSource

Get the track number.

setTrack :: FileId -> Int -> TagLib ()Source

Set the track number.

getLength :: FileId -> TagLib IntSource

Retrieves the duration of the given file, in seconds.

getBitrate :: FileId -> TagLib IntSource

Retrieves the bitrate of the given file, in kb/s.

getSampleRate :: FileId -> TagLib IntSource

Retrieves the sample rate of the given file, in Hz.

getChannels :: FileId -> TagLib IntSource

Retrieves the number of channels in the given file.