#multi-channel

much

Handling Multi-Channel Audio Signals

2 releases

Uses new Rust 2024

0.1.1 Mar 15, 2026
0.1.0 Mar 15, 2026

#440 in Audio

MIT/Apache

48KB
579 lines

Handling Multi-Channel Audio Signals in Rust

Don't define containers,
define interfaces.

—Irish proverb

Nomenclature

TODO: "frame", "sample"

The term "planar" seems to originate from FFMPEG (which also seems to use the term "packed"). It is also used in Web Audio.

Potential Alternatives

In alphabetical order. Comments might be outdated (see version numbers in links).

Existing APIs

It might be interesting to look at existing APIs to see which terms they use, which data types etc.

  • CPAL
    • traits: Sample, ...
    • input/output streams with callbacks taking &[T] and &mut [T]
      • interleaved data (see also #367)
      • no duplex support yet (see #349 and #1096)
    • types:
      pub type ChannelCount = u16;
      pub type FrameCount = u32;
      pub type SampleRate = u32;
      pub enum BufferSize {
          Default,
          Fixed(FrameCount),
      }
      
    • parameter names:
      channels: ChannelCount
      sample_rate: SampleRate
      buffer_size: BufferSize
      

Dependencies

~0–500KB