|
|
|
| Description |
| 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.
|
|
| Synopsis |
|
|
|
| Documentation |
|
| data WAVE |
| The header and stream read or written.
| | Constructors | |
|
|
| data WAVEHeader |
| Descriptive information for the audio source.
| | Constructors | | WAVEHeader | | | waveNumChannels :: Int | Samples per frame.
| | waveFrameRate :: Int | Frames per second.
| | waveBitsPerSample :: Int | Number of
significant bits of left-justified value.
| | waveFrames :: Maybe Int | If present,
number of frames in the stream.
Otherwise, can be (inefficiently)
inferred from the length of the
stream.
|
|
|
|
|
| type WAVESample = Int32 |
| Each sample is a left-justified signed integer, with
significant bits as given in the header.
|
|
| type WAVESamples = [[WAVESample]] |
| A stream is a list of frames, each of which is a list of
samples with one sample per channel.
|
|
| hGetWAVE :: Handle -> IO WAVE |
| Read the WAVE file at the given handle and return the audio data.
|
|
| getWAVEFile :: String -> IO WAVE |
| Read the WAVE file at the given path and return the audio data.
|
|
| hPutWAVE :: Handle -> WAVE -> IO () |
| Write the given audio data to the given handle as a WAVE file.
|
|
| putWAVEFile :: String -> WAVE -> IO () |
| Write the given audio data to the given path as a WAVE file.
|
|
| sampleToDouble :: WAVESample -> Double |
| Utility routine for working with audio data in floating
point format.
|
|
| doubleToSample :: Double -> WAVESample |
| Utility routine for working with audio data in floating
point format.
|
|
| tile :: Int -> Int -> [a] -> [[a]] |
|
| collect :: Int -> [a] -> [[a]] |
|
| Produced by Haddock version 2.1.0 |