- data WaveCodec = WaveCodec
- data WAVEDE = WAVEDE {}
- data WAVEDEENUM
- = WENBYTE (forall a m r. (MonadCatchIO m, Functor m) => MEnumeratorM (IOB r Word8) (IOB r Word8) m a)
- | WENDUB (forall a m r. (MonadCatchIO m, Functor m) => MEnumeratorM2 (IOB r Word8) (IOB r Double) m a)
- data WAVECHUNK
- chunkToString :: WAVECHUNK -> String
- waveReader :: (MonadCatchIO m, Functor m) => MIteratee (IOB r Word8) m (Maybe WAVEDict)
- readRiff :: MonadCatchIO m => MIteratee (IOB r Word8) m ()
- waveChunk :: String -> Maybe WAVECHUNK
- dictReadFormat :: (MonadCatchIO m, Functor m) => Int -> WAVEDict -> MIteratee (IOB r Word8) m (Maybe AudioFormat)
- dictReadFirstFormat :: (MonadCatchIO m, Functor m) => WAVEDict -> MIteratee (IOB r Word8) m (Maybe AudioFormat)
- dictReadLastFormat :: (MonadCatchIO m, Functor m) => WAVEDict -> MIteratee (IOB r Word8) m (Maybe AudioFormat)
- dictProcessData :: (MonadCatchIO m, Functor m) => Int -> WAVEDict -> MIteratee (IOB r Double) m a -> MIteratee (IOB r Word8) m (MIteratee (IOB r Double) m a)
- dictProcessData_ :: (MonadCatchIO m, Functor m) => Int -> WAVEDict -> MIteratee (IOB r Double) m a -> MIteratee (IOB r Word8) m (Maybe a)
- dictGetLengthBytes :: WAVECHUNK -> Int -> WAVEDict -> Maybe Integer
- dictGetLengthSamples :: AudioFormat -> Int -> WAVEDict -> Maybe Integer
- dictSoundInfo :: (MonadCatchIO m, Functor m) => WAVEDict -> MIteratee (IOB r Word8) m (Maybe (AudioFormat, Integer))
- writeWave :: FilePath -> AudioFormat -> MIteratee (IOBuffer r Double) AudioMonad ()
- openWave :: FilePath -> AudioMonad ()
- closeWave :: AudioMonad ()
- runWaveAM :: AudioMonad a -> IO a
- writeFormat :: AudioFormat -> AudioMonad ()
- writeDataHeader :: AudioMonad ()
- writeDataChunk :: IOBuffer r Double -> AudioMonad ()
Types
Internal types
WAVEDE | |
|
data WAVEDEENUM Source
WENBYTE (forall a m r. (MonadCatchIO m, Functor m) => MEnumeratorM (IOB r Word8) (IOB r Word8) m a) | |
WENDUB (forall a m r. (MonadCatchIO m, Functor m) => MEnumeratorM2 (IOB r Word8) (IOB r Double) m a) |
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) => MIteratee (IOB r Word8) m (Maybe WAVEDict)Source
The library function to read the WAVE dictionary
WAVE Dictionary reading/processing functions
:: (MonadCatchIO m, Functor m) | |
=> Int | Index in the format chunk list to read |
-> WAVEDict | Dictionary |
-> MIteratee (IOB r Word8) m (Maybe AudioFormat) |
Read the specified format chunk from the WAVE dictionary
dictReadFirstFormat :: (MonadCatchIO m, Functor m) => WAVEDict -> MIteratee (IOB r Word8) m (Maybe AudioFormat)Source
Read the first format chunk in the WAVE dictionary.
dictReadLastFormat :: (MonadCatchIO m, Functor m) => WAVEDict -> MIteratee (IOB r 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 |
-> MIteratee (IOB r Double) m a | |
-> MIteratee (IOB r Word8) m (MIteratee (IOB r Double) m a) |
Read the specified data chunk from the dictionary, applying the data to the specified MIteratee.
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 -> MIteratee (IOB r Word8) m (Maybe (AudioFormat, Integer))Source
Get the AudioFormat and data length from a file
Wave writing files
Writing iteratees
writeWave :: FilePath -> AudioFormat -> MIteratee (IOBuffer r 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 :: IOBuffer r Double -> AudioMonad ()Source
Write a data chunk.