Helpers over the stable PCM contract: a binary of little-endian IEEE-754 f32
samples, interleaved for stereo.
Sample count for a PCM binary is byte_size(pcm) / 4. For stereo, samples are
interleaved as [left, right, left, right, ...].
Summary
Functions
Deinterleaves a stereo PCM binary into {left, right} mono binaries.
Builds a PCM binary from a list of float samples.
Interleaves two mono PCM binaries into one stereo PCM binary.
Number of f32 samples in a PCM binary.
Decodes a PCM binary into a list of float samples.
Functions
@spec deinterleave(binary()) :: {:ok, {binary(), binary()}} | {:error, RustyOpus.Error.t()}
Deinterleaves a stereo PCM binary into {left, right} mono binaries.
Builds a PCM binary from a list of float samples.
@spec interleave(binary(), binary()) :: {:ok, binary()} | {:error, RustyOpus.Error.t()}
Interleaves two mono PCM binaries into one stereo PCM binary.
Both inputs must have the same sample count.
@spec sample_count(binary()) :: non_neg_integer()
Number of f32 samples in a PCM binary.
Decodes a PCM binary into a list of float samples.