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

Copyright© 2015 Mark Karpov
LicenseBSD 3 clause
MaintainerMark Karpov <markkarpov@opmbx.org>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Sound.HTagLib.Getter

Contents

Description

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

Synopsis

Documentation

data TagGetter a Source

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

getTags Source

Arguments

:: FilePath

Path to audio file

-> TagGetter a

Getter

-> IO 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 file type, see getTags' variation of this function.

In case of trouble HTagLibException will be thrown.

getTags' Source

Arguments

:: FilePath

Path to audio file

-> FileType

Type of audio file

-> TagGetter a

Getter

-> IO 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 Source

Getter to retrieve track title.

artistGetter :: TagGetter Artist Source

Getter to retrieve track artist.

albumGetter :: TagGetter Album Source

Getter to retrieve track album.

commentGetter :: TagGetter Comment Source

Getter to retrieve track comment.

genreGetter :: TagGetter Genre Source

Getter to retrieve genre of the track.

yearGetter :: TagGetter (Maybe Year) Source

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

trackNumberGetter :: TagGetter (Maybe TrackNumber) Source

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

durationGetter :: TagGetter Duration Source

Getter to retrieve duration in seconds.

bitRateGetter :: TagGetter BitRate Source

Getter to retrieve bit rate.

sampleRateGetter :: TagGetter SampleRate Source

Getter to retrieve sample rate.

channelsGetter :: TagGetter Channels Source

Getter to retrieve number of channels in audio data.