-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Fairly complete high-level binding to LAME encoder
--   
--   Fairly complete high-level binding to LAME encoder.
@package lame
@version 0.1.1


-- | The module provides an interface to LAME MP3 encoder. All you need to
--   do to encode a WAVE (or RF64) file is to call <a>encodeMp3</a>, which
--   see.
module Codec.Audio.LAME

-- | Encode a WAVE file or RF64 file to MP3.
--   
--   If the input file is not a valid WAVE file, <a>WaveException</a> will
--   be thrown. <a>LameException</a> is thrown when underlying LAME encoder
--   reports a problem.
--   
--   Not all sample formats and bit depth are currently supported.
--   Supported sample formats include:
--   
--   <ul>
--   <li>PCM with samples represented as signed integers &gt; 8 bit and
--   &lt;= 16 bit per mono-sample.</li>
--   <li>IEEE floating point (32 bit) samples.</li>
--   <li>IEEE floating point (64 bit) samples.</li>
--   </ul>
--   
--   If you feed the encoder with something else, expect
--   <a>LameUnsupportedSampleFormat</a> to be thrown.
encodeMp3 :: MonadIO m => EncoderSettings -> FilePath -> FilePath -> m ()

-- | LAME encoder settings.
--   
--   Currently some noise-shaping and psycho-acoustic parameters are
--   omitted, but can be added on request.
data EncoderSettings
EncoderSettings :: !Compression -> !Maybe Word -> !Maybe (Word32, Word32) -> !Bool -> !Bool -> !Maybe Word32 -> !Float -> !Bool -> !Bool -> !Bool -> !Bool -> !MetadataPlacement -> !Maybe Text -> !Maybe Text -> !Maybe Text -> !Maybe Text -> !Maybe Text -> !Maybe (Word8, Maybe Word8) -> !Maybe Text -> !Maybe ByteString -> !FilterSetup -> !FilterSetup -> EncoderSettings

-- | How to determine amount of compression to apply, see
--   <a>Compression</a>. Default value: <tt><a>CompressionRatio</a> 11</tt>
--   (corresponds to 128 kbps).
[encoderCompression] :: EncoderSettings -> !Compression

-- | Select algorithm. This variable will effect quality by selecting
--   expensive or cheap algorithms. 0 gives the best quality (very slow). 9
--   is very fast, but gives worst quality.
--   
--   <ul>
--   <li>2—near-best quality, not too slow.</li>
--   <li>5—good quality, fast.</li>
--   <li>7—OK quality, really fast.</li>
--   </ul>
--   
--   Default value: <a>Nothing</a>, meaning that LAME will select the best
--   value itself.
[encoderQuality] :: EncoderSettings -> !Maybe Word

-- | Enable “no gap” encoding. The first value in the tuple specifies
--   current index and the second value specifies total number of tracks.
--   Default value: <a>Nothing</a>—disabled.
[encoderNoGap] :: EncoderSettings -> !Maybe (Word32, Word32)

-- | Whether to enable error protection. Error protection means that 2
--   bytes from each frame for CRC checksum. Default value: <a>False</a>.
[encoderErrorProtection] :: EncoderSettings -> !Bool

-- | Whether to enforce strict ISO compliance. Default value: <a>False</a>.
[encoderStrictISO] :: EncoderSettings -> !Bool

-- | Sample rate of output file. Default value: <a>Nothing</a>, which means
--   use sample rate of input file.
[encoderSampleRate] :: EncoderSettings -> !Maybe Word32

-- | Scale input stream by multiplying samples by this value. Default
--   value: 1 (no scaling).
[encoderScale] :: EncoderSettings -> !Float

-- | Use free format. Default value: <a>False</a>.
[encoderFreeFormat] :: EncoderSettings -> !Bool

-- | Mark as copyright protected. Default value: <a>False</a>.
[encoderCopyright] :: EncoderSettings -> !Bool

-- | Mark as original. Default value: <a>True</a>.
[encoderOriginal] :: EncoderSettings -> !Bool

-- | Whether to write Xing VBR header frame. Default value: <a>True</a>.
[encoderWriteVbrTag] :: EncoderSettings -> !Bool

-- | Which container to use to write metadata. Default value:
--   <a>Id3v2Only</a>.
[encoderMetadataPlacement] :: EncoderSettings -> !MetadataPlacement

-- | Title tag to write. Default value: <a>Nothing</a>.
[encoderTagTitle] :: EncoderSettings -> !Maybe Text

-- | Artist tag to write. Default value: <a>Nothing</a>.
[encoderTagArtist] :: EncoderSettings -> !Maybe Text

-- | Album tag to write. Default value: <a>Nothing</a>.
[encoderTagAlbum] :: EncoderSettings -> !Maybe Text

-- | Year tag to write. Default value: <a>Nothing</a>.
[encoderTagYear] :: EncoderSettings -> !Maybe Text

-- | Comment tag to write. Default value: <a>Nothing</a>.
[encoderTagComment] :: EncoderSettings -> !Maybe Text

-- | Track number (first in tuple) and (optionally) total number of tracks
--   (second in tuple). Default value: <a>Nothing</a>.
[encoderTagTrack] :: EncoderSettings -> !Maybe (Word8, Maybe Word8)

-- | Genre tag to write. Default value: <a>Nothing</a>.
[encoderTagGenre] :: EncoderSettings -> !Maybe Text

-- | Album art (a picture) to write (JPEG/PNG/GIF). Default value:
--   <a>Nothing</a>.
[encoderAlbumArt] :: EncoderSettings -> !Maybe ByteString

-- | Settings for low-pass filter. Default value: <a>FilterAuto</a>.
[encoderLowpassFilter] :: EncoderSettings -> !FilterSetup

-- | Settings for high-pass filter. Default value: <a>FilterAuto</a>.
[encoderHighpassFilter] :: EncoderSettings -> !FilterSetup

-- | The data type represents supported options for compression. You can
--   specify either fixed bitrate, compression ratio, or use the VBR mode.
data Compression

-- | Specify compression by setting a fixed bitrate, e.g.
--   <tt><a>CompressionBitrate</a> 320</tt>.
CompressionBitrate :: Word -> Compression

-- | Specify compression ratio.
CompressionRatio :: Float -> Compression

-- | VBR. Here you can specify which mode to use and the second argument is
--   VBR quality from 0 (highest), to 9 (lowest). Good default is 4.
CompressionVBR :: VbrMode -> Word -> Compression

-- | Variable bitrate (VBR) modes with their associated parameters.
data VbrMode

-- | VBR RH.
VbrRh :: VbrMode

-- | VBR ABR. Parameters of the data constructor in order:
--   
--   <ul>
--   <li>Minimal bitrate</li>
--   <li>Mean bitrate</li>
--   <li>Maximal bitrate</li>
--   <li>“Hard minimal bitrate”, if <a>True</a>, then the specified minimal
--   bitrate will be enforced in all cases (normally it's violated for
--   silence).</li>
--   </ul>
VbrAbr :: Maybe Word -> Maybe Word -> Maybe Word -> Bool -> VbrMode

-- | VBR MTRH
VbrMtrh :: VbrMode

-- | Which container to use to write tags/metadata.
data MetadataPlacement

-- | Only write ID3v1 metadata
Id3v1Only :: MetadataPlacement

-- | Only write ID3v2 metadata
Id3v2Only :: MetadataPlacement

-- | Write ID3v1 and ID3v2
Id3Both :: MetadataPlacement

-- | Settings for a filter.
data FilterSetup

-- | Filter settings are chosen automatically
FilterAuto :: FilterSetup

-- | Filter is disabled
FilterDisabled :: FilterSetup

-- | The first parameter is the filter's frequency (cut-off frequency) in
--   Hz and the second parameter is width of transition band in Hz (if
--   <a>Nothing</a>, it's chosen automatically).
FilterManual :: Word -> Maybe Word -> FilterSetup

-- | Enumeration of problems you can have with LAME.
data LameException

-- | A “generic error” happened
LameGenericError :: LameException

-- | Memory allocation issue
LameNoMemory :: LameException

-- | Unsupported bitrate
LameBadBitrate :: LameException

-- | Unsupported sample rate
LameBadSampleFreq :: LameException

-- | An “Internal error” happened
LameInternalError :: LameException

-- | Invalid track number (first argument) or total number of tracks
--   (second argument) was supplied
LameInvalidTrackNumber :: Word8 -> Maybe Word8 -> LameException

-- | This sample format is not supported at this time
LameUnsupportedSampleFormat :: SampleFormat -> LameException
instance GHC.Classes.Ord Codec.Audio.LAME.EncoderSettings
instance GHC.Classes.Eq Codec.Audio.LAME.EncoderSettings
instance GHC.Read.Read Codec.Audio.LAME.EncoderSettings
instance GHC.Show.Show Codec.Audio.LAME.EncoderSettings
instance GHC.Classes.Ord Codec.Audio.LAME.FilterSetup
instance GHC.Classes.Eq Codec.Audio.LAME.FilterSetup
instance GHC.Read.Read Codec.Audio.LAME.FilterSetup
instance GHC.Show.Show Codec.Audio.LAME.FilterSetup
instance GHC.Classes.Ord Codec.Audio.LAME.MetadataPlacement
instance GHC.Classes.Eq Codec.Audio.LAME.MetadataPlacement
instance GHC.Read.Read Codec.Audio.LAME.MetadataPlacement
instance GHC.Show.Show Codec.Audio.LAME.MetadataPlacement
instance GHC.Classes.Ord Codec.Audio.LAME.Compression
instance GHC.Classes.Eq Codec.Audio.LAME.Compression
instance GHC.Read.Read Codec.Audio.LAME.Compression
instance GHC.Show.Show Codec.Audio.LAME.Compression
instance GHC.Classes.Ord Codec.Audio.LAME.VbrMode
instance GHC.Classes.Eq Codec.Audio.LAME.VbrMode
instance GHC.Read.Read Codec.Audio.LAME.VbrMode
instance GHC.Show.Show Codec.Audio.LAME.VbrMode
instance Data.Default.Class.Default Codec.Audio.LAME.EncoderSettings
