Mx.Recording (mx v0.1.0)

Copy Markdown View Source

Checks where a session can be recorded, and reads the length, peak and clips of a recording.

The engine writes the recording itself, so a path it cannot write is refused before playing starts. mxs records 32-bit floats, which keep a sound louder than full scale, and a sample at or beyond full scale counts as at full scale. Each stretch of frames with a sample at full scale in either channel counts as one clip.

Summary

Functions

Checks a recording can be written to a path: :ok, or {:error, message} naming it.

The peak of a 24-bit or 32-bit float WAV recording in dB below full scale, or nil when it is silent, with how many times it clipped and the seconds of the first clip.

The channels, sample rate and number of frames of a WAV file.

The lines mx prints after recording: the length and peak, and a warning when the recording clipped.

The length of a WAV recording in seconds.

Functions

check(path, force)

Checks a recording can be written to a path: :ok, or {:error, message} naming it.

level(path)

The peak of a 24-bit or 32-bit float WAV recording in dB below full scale, or nil when it is silent, with how many times it clipped and the seconds of the first clip.

read_wav(path)

The channels, sample rate and number of frames of a WAV file.

report(path)

The lines mx prints after recording: the length and peak, and a warning when the recording clipped.

seconds(path)

The length of a WAV recording in seconds.