-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | WAVE audio file IO library -- -- Module for reading and writing audio files in the WAVE audio format. @package WAVE @version 0.1 -- | This module implements reading and writing of the most common kinds of -- WAVE files. WAVE files are Microsoft RIFF audio sample files -- originally based on the AIFF format, and commonly have the .wav -- filename extension. This module currently supports reading and writing -- single-section little-endian PCM audio files containing up to 32-bit -- samples encoded according to the well-known WAVE sample encoding. The -- interface audio stream format is a list of frames of 32-bit -- (Int32) left-justified signed PCM samples; each frame has one -- sample per channel. The audio reader and writer are sufficiently lazy -- that files larger than memory can be processed. module Data.WAVE -- | The header and stream read or written. data WAVE WAVE :: WAVEHeader -> WAVESamples -> WAVE waveHeader :: WAVE -> WAVEHeader waveSamples :: WAVE -> WAVESamples -- | Descriptive information for the audio source. data WAVEHeader WAVEHeader :: Int -> Int -> Int -> Maybe Int -> WAVEHeader -- | Samples per frame. waveNumChannels :: WAVEHeader -> Int -- | Frames per second. waveFrameRate :: WAVEHeader -> Int -- | Number of significant bits of left-justified value. waveBitsPerSample :: WAVEHeader -> Int -- | If present, number of frames in the stream. Otherwise, can be -- (inefficiently) inferred from the length of the stream. waveFrames :: WAVEHeader -> Maybe Int -- | Each sample is a left-justified signed integer, with significant bits -- as given in the header. type WAVESample = Int32 -- | A stream is a list of frames, each of which is a list of samples with -- one sample per channel. type WAVESamples = [[WAVESample]] -- | Read the WAVE file at the given handle and return the audio data. hGetWAVE :: Handle -> IO WAVE -- | Read the WAVE file at the given path and return the audio data. getWAVEFile :: String -> IO WAVE -- | Write the given audio data to the given handle as a WAVE file. hPutWAVE :: Handle -> WAVE -> IO () -- | Write the given audio data to the given path as a WAVE file. putWAVEFile :: String -> WAVE -> IO () -- | Utility routine for working with audio data in floating point format. sampleToDouble :: WAVESample -> Double -- | Utility routine for working with audio data in floating point format. doubleToSample :: Double -> WAVESample tile :: Int -> Int -> [a] -> [[a]] collect :: Int -> [a] -> [[a]]