udoprog / audio

A crate for working with audio in Rust
Apache License 2.0
78 stars 11 forks source link

Add support for immutable frame abstractions #5

Closed udoprog closed 2 years ago

udoprog commented 2 years ago

First step towards #3

This adds the following traits:

The name UniformBuf currently stems from how frame access presupposes that each channel in the audio buffer has a uniform number of samples. That means it currently won't be implemented for types which have variable channels such as audio::buf::Dynamic. At the moment this is not being specifically leveraged and UniformBuf might be merged into Buf.

TODO

Channel access is still considered a bit too special in that its the "default" through Buf::iter and Buf::get and the like. This will be renamed but would constitute a large change. Or we keep it as is, but then we need to determine whether channel of frame access should be the default.