Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- with :: IO a -> IO a
- formatWith :: IO a -> IO a
- openRead :: ReaderInfo -> FilePath -> IO (FormatPtr ReadMode)
- withRead :: ReaderInfo -> FilePath -> (FormatPtr ReadMode -> IO a) -> IO a
- readStorableVector :: FormatPtr ReadMode -> Int -> IO (Vector Int32)
- readStorableVectorLazy :: FormatPtr ReadMode -> ChunkSize -> IO (Vector Int32)
- openWrite :: WriterInfo -> FilePath -> IO (FormatPtr WriteMode)
- withWrite :: WriterInfo -> FilePath -> (FormatPtr WriteMode -> IO a) -> IO a
- writeStorableVector :: FormatPtr WriteMode -> Vector Int32 -> IO ()
- writeStorableVectorLazy :: FormatPtr WriteMode -> Vector Int32 -> IO ()
- storableVectorLazyFromByteString :: ReaderInfo -> ByteString -> ChunkSize -> Maybe (Vector Int32)
- close :: Mode mode => FormatPtr mode -> IO ()
- seek :: Mode mode => FormatPtr mode -> Int -> IO ()
- class Mode mode where
- getModeChar :: Format mode -> CChar
- data ReadMode
- data WriteMode
- data ReaderInfo = ReaderInfo {}
- defaultReaderInfo :: ReaderInfo
- data WriterInfo = WriterInfo {}
- defaultWriterInfo :: WriterInfo
- type Rate = Double
- newtype FileType = FileType {
- unFileType :: String
- data Format mode = Format {}
- data SignalInfo = SignalInfo {}
- data EncodingInfo = EncodingInfo {}
- 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
Documentation
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.
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.
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.
data ReaderInfo Source #
data WriterInfo Source #
Instances
Mode mode => Storable (Format mode) Source # | |
Defined in Sound.SoxLib.FFI 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 () # |
data SignalInfo Source #
Instances
Show SignalInfo Source # | |
Defined in Sound.SoxLib.FFI showsPrec :: Int -> SignalInfo -> ShowS # show :: SignalInfo -> String # showList :: [SignalInfo] -> ShowS # | |
Storable SignalInfo Source # | |
Defined in Sound.SoxLib.FFI sizeOf :: SignalInfo -> Int # alignment :: SignalInfo -> Int # peekElemOff :: Ptr SignalInfo -> Int -> IO SignalInfo # pokeElemOff :: Ptr SignalInfo -> Int -> SignalInfo -> IO () # peekByteOff :: Ptr b -> Int -> IO SignalInfo # pokeByteOff :: Ptr b -> Int -> SignalInfo -> IO () # peek :: Ptr SignalInfo -> IO SignalInfo # poke :: Ptr SignalInfo -> SignalInfo -> IO () # |
data EncodingInfo Source #
EncodingInfo | |
|
Instances
Show EncodingInfo Source # | |
Defined in Sound.SoxLib.FFI showsPrec :: Int -> EncodingInfo -> ShowS # show :: EncodingInfo -> String # showList :: [EncodingInfo] -> ShowS # | |
Storable EncodingInfo Source # | |
Defined in Sound.SoxLib.FFI sizeOf :: EncodingInfo -> Int # alignment :: EncodingInfo -> Int # peekElemOff :: Ptr EncodingInfo -> Int -> IO EncodingInfo # pokeElemOff :: Ptr EncodingInfo -> Int -> EncodingInfo -> IO () # peekByteOff :: Ptr b -> Int -> IO EncodingInfo # pokeByteOff :: Ptr b -> Int -> EncodingInfo -> IO () # peek :: Ptr EncodingInfo -> IO EncodingInfo # poke :: Ptr EncodingInfo -> EncodingInfo -> IO () # |
Instances
Show IOType Source # | |
Storable IOType Source # | |
Instances
Show Option Source # | |
Storable Option Source # | |
Instances
Bounded Encoding Source # | |
Show Encoding Source # | |
Storable Encoding Source # | |