soxlib-0.0.3.2: Write, read, convert audio signals using libsox

Safe HaskellNone
LanguageHaskell98

Sound.SoxLib

Synopsis

Documentation

with :: IO a -> IO a Source #

formatWith :: IO a -> IO a Source #

All SoxLib operations must be enclosed in formatWith. You must only call it once per program.

openRead :: ReaderInfo -> FilePath -> IO (FormatPtr ReadMode) Source #

This function will never return a nullPtr. Instead it throws a user exception if the file cannot be opened.

withRead :: ReaderInfo -> FilePath -> (FormatPtr ReadMode -> IO a) -> IO a Source #

readStorableVector :: FormatPtr ReadMode -> Int -> IO (Vector Int32) Source #

Multi-channel data is interleaved. size must be divisible by the number of channels.

readStorableVectorLazy :: FormatPtr ReadMode -> ChunkSize -> IO (Vector Int32) Source #

Read complete file lazily into chunky storable vector. The chunkSize must be divisible by the number of channels.

openWrite :: WriterInfo -> FilePath -> IO (FormatPtr WriteMode) Source #

This function will never return a nullPtr. Instead it throws a user exception if the file cannot be opened.

withWrite :: WriterInfo -> FilePath -> (FormatPtr WriteMode -> IO a) -> IO a Source #

writeStorableVector :: FormatPtr WriteMode -> Vector Int32 -> IO () Source #

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.

writeStorableVectorLazy :: FormatPtr WriteMode -> Vector Int32 -> IO () Source #

The chunkSize must be divisible by the number of channels.

storableVectorLazyFromByteString :: ReaderInfo -> ByteString -> ChunkSize -> Maybe (Vector Int32) Source #

It reads lazily to lazy storable vector. That is, the whole ByteString is kept as long as we process the lazy storable vector.

close :: Mode mode => FormatPtr mode -> IO () Source #

seek :: Mode mode => FormatPtr mode -> Int -> IO () Source #

class Mode mode where Source #

Methods

getModeChar :: Format mode -> CChar Source #

Instances
Mode WriteMode Source # 
Instance details

Defined in Sound.SoxLib.FFI

Mode ReadMode Source # 
Instance details

Defined in Sound.SoxLib.FFI

data ReadMode Source #

Instances
Mode ReadMode Source # 
Instance details

Defined in Sound.SoxLib.FFI

data WriteMode Source #

Instances
Mode WriteMode Source # 
Instance details

Defined in Sound.SoxLib.FFI

newtype FileType Source #

Constructors

FileType 

Fields

Instances
Show FileType Source # 
Instance details

Defined in Sound.SoxLib.FFI

data Format mode Source #

Instances
Mode mode => Storable (Format mode) Source # 
Instance details

Defined in Sound.SoxLib.FFI

Methods

sizeOf :: Format mode -> Int #

alignment :: Format mode -> Int #

peekElemOff :: Ptr (Format mode) -> Int -> IO (Format mode) #

pokeElemOff :: Ptr (Format mode) -> Int -> Format mode -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Format mode) #

pokeByteOff :: Ptr b -> Int -> Format mode -> IO () #

peek :: Ptr (Format mode) -> IO (Format mode) #

poke :: Ptr (Format mode) -> Format mode -> IO () #

data IOType Source #

Instances
Show IOType Source # 
Instance details

Defined in Sound.SoxLib.FFI

Storable IOType Source # 
Instance details

Defined in Sound.SoxLib.FFI

data Option Source #

Instances
Show Option Source # 
Instance details

Defined in Sound.SoxLib.FFI

Storable Option Source # 
Instance details

Defined in Sound.SoxLib.FFI

data Encoding Source #

Instances
Bounded Encoding Source # 
Instance details

Defined in Sound.SoxLib.FFI

Show Encoding Source # 
Instance details

Defined in Sound.SoxLib.FFI

Storable Encoding Source # 
Instance details

Defined in Sound.SoxLib.FFI