AirPlay.Source (AirPlay v0.1.0)

Copy Markdown View Source

Decode a library track to the PCM format AirPlay/RAOP wants: 44.1 kHz, 16-bit, stereo, little-endian, via ffmpeg. Returns the raw interleaved s16le bytes, which AirPlay.Alac chops into 352-sample frames.

Summary

Functions

Split PCM into frames-sample stereo chunks (last one zero-padded).

Decode path to interleaved s16le stereo @44.1kHz, or {:error, reason}.

Functions

frames(pcm, frames \\ 352)

@spec frames(binary(), pos_integer()) :: [binary()]

Split PCM into frames-sample stereo chunks (last one zero-padded).

pcm(path)

@spec pcm(String.t()) :: {:ok, binary()} | {:error, term()}

Decode path to interleaved s16le stereo @44.1kHz, or {:error, reason}.