liveBook · Manning

WAV

As explained in Learn Haskell by Example

The WAV file format is a standard container format for storing digital audio data, commonly with uncompressed PCM samples.

WAV is a standard container for digital audio, commonly storing uncompressed PCM samples. In Haskell, HCodecs writes generated signals to WAV files that most audio players can play. section 10.1.2

Export four waveforms

writeWav "4waves.wav" $ concatMap (\w -> tone w 220 5) [sin, tri, saw, sqw] generates a five-second, 220-Hz segment for each waveform and writes the combined audio to a WAV file.

How Learn Haskell by Example covers it

How deep it goes
Explains signal conversion, clamping, Audio construction, and file export, but defers array internals.
Examples
Demonstrates exporting concatenated sine, triangle, sawtooth, and square waveforms as fourwaves.wav.
What it assumes
Assumes Haskell signals and basic lists, while introducing Audio values, SampleData, arrays, and sample conversion.
What you can do after
Builds a WAV exporter that converts bounded signals into sample data and writes playable audio files.
How it connects
Connects WAV with audio signals, sample rate, channels, PCM samples, arrays, and HCodecs.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Haskell by Example. The section links point to the parts of the book it draws on.