Module audio::wrap

source ·
Expand description

This module provides wrappers to pass audio data from crates which use different buffer formats into functions that take Buf or BufMut without needing to copy data into an intermediate buffer. They may also be useful for incrementally introducing this crate into a codebase that uses a different buffer format.

Structs

  • A wrapper for an external dynamic audio buffer.
  • A wrapper for an interleaved audio buffer.
  • A wrapper for a sequential audio buffer.

Functions

  • Wrap a Vec of Vecs or slice of Vecs where each inner Vec is a channel. The channels do not need to be equally sized.
  • Wrap a slice as an interleaved buffer with the given number of channels.
  • Wrap a slice as a sequential buffer with the given number of frames. The length of the buffer determines the number of channels it has.