htaglib-1.1.1: Bindings to TagLib, audio meta-data library

Copyright© 2015–2017 Mark Karpov
LicenseBSD 3 clause
MaintainerMark Karpov <markkarpov92@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Sound.HTagLib.Getter

Contents

Description

A high-level applicative interface for reading of audio meta data. You don't need to import this module directly, import Sound.HTagLib instead.

Synopsis

High-level API

data TagGetter a #

A composable entity that can be used with getTags or getTags' functions to read batch of meta parameters.

Instances

Functor TagGetter # 

Methods

fmap :: (a -> b) -> TagGetter a -> TagGetter b #

(<$) :: a -> TagGetter b -> TagGetter a #

Applicative TagGetter # 

Methods

pure :: a -> TagGetter a #

(<*>) :: TagGetter (a -> b) -> TagGetter a -> TagGetter b #

(*>) :: TagGetter a -> TagGetter b -> TagGetter b #

(<*) :: TagGetter a -> TagGetter b -> TagGetter a #

getTags #

Arguments

:: MonadIO m 
=> FilePath

Path to audio file

-> TagGetter a

Getter

-> m a

Extracted data

getTags path g will try to read file located at path and read meta data of the file using getter g. Type of file will be guessed from its extension. If this is not satisfactory and you want to explicitly specify the file type, see getTags' variation of this function.

In the case of trouble HTagLibException will be thrown.

getTags' #

Arguments

:: MonadIO m 
=> FilePath

Path to audio file

-> FileType

Type of audio file

-> TagGetter a

Getter

-> m a

Extracted data

This is essentially the same as getTags, but allows to explicitly choose file type (see FileType).

Built-in getters

titleGetter :: TagGetter Title #

Getter to retrieve track title.

artistGetter :: TagGetter Artist #

Getter to retrieve track artist.

albumGetter :: TagGetter Album #

Getter to retrieve track album.

commentGetter :: TagGetter Comment #

Getter to retrieve track comment.

genreGetter :: TagGetter Genre #

Getter to retrieve genre of the track.

yearGetter :: TagGetter (Maybe Year) #

Getter to retrieve year to the track (returns Nothing if the data is missing).

trackNumberGetter :: TagGetter (Maybe TrackNumber) #

Getter to retrieve track number (returns Nothing if the data is missing).

durationGetter :: TagGetter Duration #

Getter to retrieve duration in seconds.

bitRateGetter :: TagGetter BitRate #

Getter to retrieve bit rate.

sampleRateGetter :: TagGetter SampleRate #

Getter to retrieve sample rate.

channelsGetter :: TagGetter Channels #

Getter to retrieve number of channels in audio data.