- data WaveCodec = WaveCodec
- type WAVEDict = IntMap [WAVEDE]
- data WAVEDE = WAVEDE {}
- data WAVEDEENUM
- data WAVECHUNK
- chunkToString :: WAVECHUNK -> String
- waveReader :: (MonadCatchIO m, Functor m) => Iteratee (Vector Word8) m (Maybe WAVEDict)
- readRiff :: MonadCatchIO m => Iteratee (Vector Word8) m Bool
- waveChunk :: String -> Maybe WAVECHUNK
- dictReadFormat :: (MonadCatchIO m, Functor m) => Int -> WAVEDict -> Iteratee (Vector Word8) m (Maybe AudioFormat)
- dictReadFirstFormat :: (MonadCatchIO m, Functor m) => WAVEDict -> Iteratee (Vector Word8) m (Maybe AudioFormat)
- dictReadLastFormat :: (MonadCatchIO m, Functor m) => WAVEDict -> Iteratee (Vector Word8) m (Maybe AudioFormat)
- dictProcessData :: (MonadCatchIO m, Functor m) => Int -> WAVEDict -> Iteratee (Vector Double) m a -> Iteratee (Vector Word8) m (Iteratee (Vector Double) m a)
- dictProcessData_ :: (MonadCatchIO m, Functor m) => Int -> WAVEDict -> Iteratee (Vector Double) m a -> Iteratee (Vector Word8) m (Maybe a)
- dictGetLengthBytes :: WAVECHUNK -> Int -> WAVEDict -> Maybe Integer
- dictGetLengthSamples :: AudioFormat -> Int -> WAVEDict -> Maybe Integer
- dictSoundInfo :: (MonadCatchIO m, Functor m) => WAVEDict -> Iteratee (Vector Word8) m (Maybe (AudioFormat, Integer))
- writeWave :: FilePath -> AudioFormat -> Iteratee (Vector Double) AudioMonad ()
- openWave :: FilePath -> AudioMonad ()
- closeWave :: AudioMonad ()
- runWaveAM :: AudioMonad a -> IO a
- writeFormat :: AudioFormat -> AudioMonad ()
- writeDataHeader :: AudioMonad ()
- writeDataChunk :: Vector Double -> AudioMonad ()
Types
Internal types
type WAVEDict = IntMap [WAVEDE]Source
A WAVE directory is a list associating WAVE chunks with a record WAVEDE
WAVEDE | |
|
data WAVEDEENUM Source
WAVE CHUNK types
Standard WAVE Chunks
chunkToString :: WAVECHUNK -> StringSource
Convert a WAVECHUNK to the representative string
Wave reading Iteratees
Basic wave reading
waveReader :: (MonadCatchIO m, Functor m) => Iteratee (Vector Word8) m (Maybe WAVEDict)Source
The library function to read the WAVE dictionary
readRiff :: MonadCatchIO m => Iteratee (Vector Word8) m BoolSource
Read the RIFF header of a file. Returns True if the file is a valid RIFF.
WAVE Dictionary reading/processing functions
:: (MonadCatchIO m, Functor m) | |
=> Int | Index in the format chunk list to read |
-> WAVEDict | Dictionary |
-> Iteratee (Vector Word8) m (Maybe AudioFormat) |
Read the specified format chunk from the WAVE dictionary
dictReadFirstFormat :: (MonadCatchIO m, Functor m) => WAVEDict -> Iteratee (Vector Word8) m (Maybe AudioFormat)Source
Read the first format chunk in the WAVE dictionary.
dictReadLastFormat :: (MonadCatchIO m, Functor m) => WAVEDict -> Iteratee (Vector Word8) m (Maybe AudioFormat)Source
Read the last fromat chunk from the WAVE dictionary. This is useful when parsing all chunks in the dictionary.
:: (MonadCatchIO m, Functor m) | |
=> Int | Index in the data chunk list to read |
-> WAVEDict | Dictionary |
-> Iteratee (Vector Double) m a | |
-> Iteratee (Vector Word8) m (Iteratee (Vector Double) m a) |
Read the specified data chunk from the dictionary, applying the data to the specified Iteratee.
Information on WAVE chunks
dictGetLengthBytes :: WAVECHUNK -> Int -> WAVEDict -> Maybe IntegerSource
Get the length of data in a dictionary chunk, in bytes.
dictGetLengthSamples :: AudioFormat -> Int -> WAVEDict -> Maybe IntegerSource
Get the length of a data chunk, in samples.
dictSoundInfo :: (MonadCatchIO m, Functor m) => WAVEDict -> Iteratee (Vector Word8) m (Maybe (AudioFormat, Integer))Source
Get the AudioFormat and data length from a file
Wave writing files
Writing iteratees
writeWave :: FilePath -> AudioFormat -> Iteratee (Vector Double) AudioMonad ()Source
Create an iteratee to write data to a wave file.
Primitive wave writing functions
openWave :: FilePath -> AudioMonad ()Source
Open a wave file for writing
runWaveAM :: AudioMonad a -> IO aSource
writeFormat :: AudioFormat -> AudioMonad ()Source
Write a data format block to the open wave file
writeDataHeader :: AudioMonad ()Source
Write the header for a Data chunk.
writeDataChunk :: Vector Double -> AudioMonad ()Source
Write a data chunk.