-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Write, read, convert audio signals using libsox
--
-- This is an FFI binding to libsox of the Sox (Sound Exchanger)
-- project http://sox.sourceforge.net/. It lets write, read and
-- convert audio signals in various formats, resolutions, and numbers of
-- channels.
--
-- The package sox has similar functionality but calls the
-- sox shell command.
@package soxlib
@version 0.0.3.2
module Sound.SoxLib
with :: IO a -> IO a
-- | All SoxLib operations must be enclosed in formatWith. You must
-- only call it once per program.
formatWith :: IO a -> IO a
-- | This function will never return a nullPtr. Instead it throws a
-- user exception if the file cannot be opened.
openRead :: ReaderInfo -> FilePath -> IO (FormatPtr ReadMode)
withRead :: ReaderInfo -> FilePath -> (FormatPtr ReadMode -> IO a) -> IO a
-- | Multi-channel data is interleaved. size must be divisible by
-- the number of channels.
readStorableVector :: FormatPtr ReadMode -> Int -> IO (Vector Int32)
-- | Read complete file lazily into chunky storable vector. The chunkSize
-- must be divisible by the number of channels.
readStorableVectorLazy :: FormatPtr ReadMode -> ChunkSize -> IO (Vector Int32)
-- | This function will never return a nullPtr. Instead it throws a
-- user exception if the file cannot be opened.
openWrite :: WriterInfo -> FilePath -> IO (FormatPtr WriteMode)
withWrite :: WriterInfo -> FilePath -> (FormatPtr WriteMode -> IO a) -> IO a
-- | Multi-channel data is interleaved. size must be divisible by
-- the number of channels.
--
-- Caution: Writing large chunks (e.g. more than 8192 samples) may crash
-- the FLAC backend.
writeStorableVector :: FormatPtr WriteMode -> Vector Int32 -> IO ()
-- | The chunkSize must be divisible by the number of channels.
writeStorableVectorLazy :: FormatPtr WriteMode -> Vector Int32 -> IO ()
-- | It reads lazily to lazy storable vector. That is, the whole
-- ByteString is kept as long as we process the lazy storable
-- vector.
storableVectorLazyFromByteString :: ReaderInfo -> ByteString -> ChunkSize -> Maybe (Vector Int32)
close :: Mode mode => FormatPtr mode -> IO ()
seek :: Mode mode => FormatPtr mode -> Int -> IO ()
class Mode mode
getModeChar :: Mode mode => Format mode -> CChar
data ReadMode
data WriteMode
data ReaderInfo
ReaderInfo :: Maybe SignalInfo -> Maybe EncodingInfo -> Maybe FileType -> ReaderInfo
[readerSignalInfo] :: ReaderInfo -> Maybe SignalInfo
[readerEncodingInfo] :: ReaderInfo -> Maybe EncodingInfo
[readerFileType] :: ReaderInfo -> Maybe FileType
defaultReaderInfo :: ReaderInfo
data WriterInfo
WriterInfo :: Maybe SignalInfo -> Maybe EncodingInfo -> Maybe FileType -> WriterInfo
[writerSignalInfo] :: WriterInfo -> Maybe SignalInfo
[writerEncodingInfo] :: WriterInfo -> Maybe EncodingInfo
[writerFileType] :: WriterInfo -> Maybe FileType
defaultWriterInfo :: WriterInfo
type Rate = Double
newtype FileType
FileType :: String -> FileType
[unFileType] :: FileType -> String
data Format mode
Format :: FilePath -> SignalInfo -> EncodingInfo -> FileType -> Bool -> Int -> Int -> Errno -> String -> Ptr CFile -> IOType -> CLong -> CLong -> Ptr () -> Format mode
[filename] :: Format mode -> FilePath
[signalInfo] :: Format mode -> SignalInfo
[encodingInfo] :: Format mode -> EncodingInfo
[filetype] :: Format mode -> FileType
[seekable] :: Format mode -> Bool
[olength] :: Format mode -> Int
[clips] :: Format mode -> Int
[soxErrno] :: Format mode -> Errno
[soxErrStr] :: Format mode -> String
[fp] :: Format mode -> Ptr CFile
[ioType] :: Format mode -> IOType
[tellOff] :: Format mode -> CLong
[dataStart] :: Format mode -> CLong
[priv] :: Format mode -> Ptr ()
data SignalInfo
SignalInfo :: Maybe Rate -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Double -> SignalInfo
[rate] :: SignalInfo -> Maybe Rate
[channels] :: SignalInfo -> Maybe Int
[precision] :: SignalInfo -> Maybe Int
[length] :: SignalInfo -> Maybe Int
[mult] :: SignalInfo -> Maybe Double
data EncodingInfo
EncodingInfo :: Encoding -> Int -> Double -> Option -> Bool -> EncodingInfo
[encoding] :: EncodingInfo -> Encoding
[bitsPerSample] :: EncodingInfo -> Int
[compression] :: EncodingInfo -> Double
[reverseBytes, reverseNibbles, reverseBits] :: EncodingInfo -> Option
[oppositeEndian] :: EncodingInfo -> Bool
defaultSignalInfo :: SignalInfo
data IOType
ioFile :: IOType
ioPipe :: IOType
ioURL :: IOType
data Option
optionNo :: Option
optionYes :: Option
optionDefault :: Option
data Encoding
encodingUnknown :: Encoding
encodingSign2 :: Encoding
encodingUnsigned :: Encoding
encodingFloat :: Encoding
encodingFloatText :: Encoding
encodingFlac :: Encoding
encodingHcom :: Encoding
encodingWavpack :: Encoding
encodingWavpackf :: Encoding
encodingUlaw :: Encoding
encodingAlaw :: Encoding
encodingG721 :: Encoding
encodingG723 :: Encoding
encodingClADPCM :: Encoding
encodingClADPCM16 :: Encoding
encodingMsADPCM :: Encoding
encodingImaADPCM :: Encoding
encodingOkiADPCM :: Encoding
encodingDPCM :: Encoding
encodingDWVW :: Encoding
encodingDWVWN :: Encoding
encodingGSM :: Encoding
encodingMP3 :: Encoding
encodingVorbis :: Encoding
encodingAmrWB :: Encoding
encodingAmrNB :: Encoding
encodingCVSD :: Encoding
encodingLPC10 :: Encoding