WAVE-0.1.5: WAVE audio file IO library

Safe HaskellSafe
LanguageHaskell2010

Data.WAVE

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 Source #

The header and stream read or written.

Constructors

WAVE 

data WAVEHeader Source #

Descriptive information for the audio source.

Constructors

WAVEHeader 

Fields

type WAVESample = Int32 Source #

Each sample is a left-justified signed integer, with significant bits as given in the header.

type WAVESamples = [[WAVESample]] Source #

A stream is a list of frames, each of which is a list of samples with one sample per channel.

hGetWAVE :: Handle -> IO WAVE Source #

Read the WAVE file at the given handle and return the audio data.

getWAVEFile :: String -> IO WAVE Source #

Read the WAVE file at the given path and return the audio data.

hPutWAVE :: Handle -> WAVE -> IO () Source #

Write the given audio data to the given handle as a WAVE file.

putWAVEFile :: String -> WAVE -> IO () Source #

Write the given audio data to the given path as a WAVE file.

sampleToDouble :: WAVESample -> Double Source #

Utility routine for working with audio data in floating point format.

doubleToSample :: Double -> WAVESample Source #

Utility routine for working with audio data in floating point format.