Safe Haskell | None |
---|---|
Language | Haskell98 |
High level API for decoding Ogg-Vorbis files or streams. This module is intended to be imported qualified, e.g.
import qualified Codec.Audio.Vorbis.File as V
- openFile :: FilePath -> IO File
- openCallbacks :: (Int -> Int -> IO ByteString) -> IO () -> Maybe (SeekMode -> Integer -> IO (), IO Integer) -> IO File
- withFile :: FilePath -> (File -> IO a) -> IO a
- withCallbacks :: (Int -> Int -> IO ByteString) -> IO () -> Maybe (SeekMode -> Integer -> IO (), IO Integer) -> (File -> IO a) -> IO a
- data File
- info :: File -> IO Info
- data Info = Info {}
- data Channels
- read :: File -> Int -> Endianness -> WordSize -> Signedness -> IO (Maybe (ByteString, Int))
- data Endianness :: *
- getSystemEndianness :: Endianness
- data WordSize
- data Signedness
- close :: File -> IO ()
Opening file or streams
:: (Int -> Int -> IO ByteString) | Read function, taking size and nmemb |
-> IO () | Close function |
-> Maybe (SeekMode -> Integer -> IO (), IO Integer) | Seek and tell functions |
-> IO File |
Decode Ogg-Vorbis using the specified callbacks to do the back-end I/O. Seek and tell functions are optional.
File metadata
Read data from file
:: File | |
-> Int | Maximum bytes to read (will typically return less than this) |
-> Endianness | How to encode the samples as bytes |
-> WordSize | Desired word size |
-> Signedness | Whether you want signed or unsigned values |
-> IO (Maybe (ByteString, Int)) |
Read data from the file. Returns the data block and the number of the current
logical bitstream. Nothing
for end of file.
data Endianness :: * #
represent the CPU endianness
Big endian system stores bytes with the MSB as the first byte. Little endian system stores bytes with the LSB as the first byte.
middle endian is purposely avoided.
getSystemEndianness :: Endianness #
return the system endianness
data Signedness Source #