-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell bindings for libsndfile -- -- Haskell bindings for libsndfile. -- -- Libsndfile is a comprehensive C library for reading and writing a -- large number of soundfile formats: -- http://www.mega-nerd.com/libsndfile/. -- -- Changelog and source tarballs can be found at -- http://space.k-hornz.de/files/software/hsndfile @package hsndfile @version 0.3.2 -- | Sound.File.Sndfile provides a Haskell interface to the -- ubiquitous libsndfile library by Erik de Castro Lopo (visit the -- author's website at http://www.mega-nerd.com/libsndfile/). module Sound.File.Sndfile type Count = Int type Index = Int -- | Stream format specification, consisting of header, sample and -- endianness formats. -- -- Not all combinations of header, sample and endianness formats are -- valid; valid combinamtions can be checked with the checkFormat -- function. data Format Format :: HeaderFormat -> SampleFormat -> EndianFormat -> Format headerFormat :: Format -> HeaderFormat sampleFormat :: Format -> SampleFormat endianFormat :: Format -> EndianFormat -- | Header format. data HeaderFormat HeaderFormatNone :: HeaderFormat HeaderFormatWav :: HeaderFormat HeaderFormatAiff :: HeaderFormat HeaderFormatAu :: HeaderFormat HeaderFormatRaw :: HeaderFormat HeaderFormatPaf :: HeaderFormat HeaderFormatSvx :: HeaderFormat HeaderFormatNist :: HeaderFormat HeaderFormatVoc :: HeaderFormat HeaderFormatIrcam :: HeaderFormat HeaderFormatW64 :: HeaderFormat HeaderFormatMat4 :: HeaderFormat HeaderFormatMat5 :: HeaderFormat HeaderFormatPvf :: HeaderFormat HeaderFormatXi :: HeaderFormat HeaderFormatHtk :: HeaderFormat HeaderFormatSds :: HeaderFormat HeaderFormatAvr :: HeaderFormat HeaderFormatWavex :: HeaderFormat HeaderFormatSd2 :: HeaderFormat HeaderFormatFlac :: HeaderFormat HeaderFormatCaf :: HeaderFormat -- | Sample format. data SampleFormat SampleFormatNone :: SampleFormat SampleFormatPcmS8 :: SampleFormat SampleFormatPcm16 :: SampleFormat SampleFormatPcm24 :: SampleFormat SampleFormatPcm32 :: SampleFormat SampleFormatPcmU8 :: SampleFormat SampleFormatFloat :: SampleFormat SampleFormatDouble :: SampleFormat SampleFormatUlaw :: SampleFormat SampleFormatAlaw :: SampleFormat SampleFormatImaAdpcm :: SampleFormat SampleFormatMsAdpcm :: SampleFormat SampleFormatGsm610 :: SampleFormat SampleFormatVoxAdpcm :: SampleFormat SampleFormatG72132 :: SampleFormat SampleFormatG72324 :: SampleFormat SampleFormatG72340 :: SampleFormat SampleFormatDwvw12 :: SampleFormat SampleFormatDwvw16 :: SampleFormat SampleFormatDwvw24 :: SampleFormat SampleFormatDwvwN :: SampleFormat SampleFormatFormatDpcm8 :: SampleFormat SampleFormatFormatDpcm16 :: SampleFormat -- | Endianness. data EndianFormat EndianFile :: EndianFormat EndianLittle :: EndianFormat EndianBig :: EndianFormat EndianCpu :: EndianFormat -- | Default 'empty' format, useful when opening files for reading with -- ReadMode. defaultFormat :: Format -- | The Info structure is for passing data between the calling -- function and the library when opening a stream for reading or writing. data Info Info :: Count -> Int -> Int -> Format -> Int -> Bool -> Info -- | Number of frames in file frames :: Info -> Count -- | Audio sample rate samplerate :: Info -> Int -- | Number of channels channels :: Info -> Int -- | Header and sample format format :: Info -> Format -- | Number of sections sections :: Info -> Int -- | True when stream is seekable (e.g. local files) seekable :: Info -> Bool -- | Return soundfile duration in seconds computed via the Info -- fields frames and samplerate. duration :: Info -> Double -- | Default 'empty' info, useful when opening files for reading with -- ReadMode. defaultInfo :: Info -- | This function allows the caller to check if a set of parameters in the -- Info struct is valid before calling openFile -- (WriteMode). -- -- checkFormat returns True if the parameters are valid and -- False otherwise. checkFormat :: Info -> Bool -- | Abstract file handle. data Handle -- | Return the stream Info associated with the Handle. hInfo :: Handle -> Info hIsSeekable :: Handle -> IO Bool -- | I/O mode. data IOMode ReadMode :: IOMode WriteMode :: IOMode ReadWriteMode :: IOMode openFile :: FilePath -> IOMode -> Info -> IO Handle -- | Get header format information associated with file. getFileInfo :: FilePath -> IO Info -- | If the stream is opened with WriteMode or ReadWriteMode, -- call the operating system's function to force the writing of all file -- cache buffers to disk. If the file is opened with ReadMode no -- action is taken. hFlush :: Handle -> IO () -- | The hClose function closes the stream, deallocates its internal -- buffers and returns () on success or signals an Exception -- otherwise. hClose :: Handle -> IO () data SeekMode AbsoluteSeek :: SeekMode RelativeSeek :: SeekMode SeekFromEnd :: SeekMode -- | The file seek functions work much like System.IO.hseek with -- the exception that the non-audio data is ignored and the seek only -- moves within the audio data section of the file. In addition, seeks -- are defined in number of (multichannel) frames. Therefore, a seek in a -- stereo file from the current position forward with an offset of 1 -- would skip forward by one sample of both channels. -- -- like lseek(), the whence parameter can be any one of the following -- three values: -- --