# `Mx.Audio`
[🔗](https://github.com/mx-music/mx/blob/main/lib/mx/audio.ex#L1)

Reads WAV and AIFF recordings, in mono or stereo, at any sample rate, as one channel of samples from -1 to 1.

A recording with several channels is read as their average.
It also writes mono WAV files of 32-bit floats.
WAV may hold integers of 8 to 32 bits or floats of 32 or 64 bits; AIFF holds big-endian integers, and AIFF-C also little-endian integers and floats.

# `read`

Reads a recording, and returns `{:ok, %{rate: rate, samples: samples}}` or `{:error, "cannot read PATH"}`.

# `write`

Writes samples from -1 to 1 to a mono WAV file of 32-bit floats at a sample rate.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
