Module rsynth::buffer [−][src]
Audio buffers.
Some audio concepts
A sample is a single number representing the air pressure at a given time.
It is usually represented by an f32
, f64
, i16
or i32
number, but other
types are possible as well.
A channel usually corresponds with a speaker or a number of speakers. E.g. in a stereo setup, there is a “left” channel and a “right” channel.
A frame consists of the samples for all the channels at a given time.
A buffer consists of subsequent samples for a given channel and corresponds to a certain time period. (Non-standard terminology.)
A chunk consists of the buffers for all channels for a given time period. (Non-standard terminology.)
┌ chunk ┌ frame
┌ sample ↓ ↓
│ ┌─────────┐ ┌─┐
┌──↓──────┼─────────┼─────┼─┼───────────────────┐
channel →│• • • • •│• • • • •│• • •│•│• • • • • • • • • •│
└─────────┼─────────┼─────┼─┼───────────────────┘
• • • • •│• • • • •│• • •│•│• • • • • • • • • •
│ │ │ │ ┌───────┐
• • • • •│• • • • •│• • •│•│• •│• • • •│• • • •
└─────────┘ └─┘ └───────┘
↑
└ buffer
Structs
AudioBufferIn | Audio input buffer. |
AudioBufferInOut | A buffer holding both input and output audio. |
AudioBufferOut | An audio output buffer. |
AudioBufferOutChannelIteratorMut | An iterator over the channels of an |
AudioChunk | A buffer representing a fixed amount of samples for a fixed amount of audio channels. |
InterlacedSampleIterator | An iterator over the samples of an |
Functions
buffers_as_mut_slice | |
buffers_as_slice |