Enum dynwave::BufferSize
source · pub enum BufferSize {
QuarterSecond,
HalfSecond,
OneSecond,
Samples(usize),
}
Expand description
The BufferSize
enum represents the amount of audio samples that can be stored in the buffer.
Limiting the number of samples in the buffer is crucial for minimizing audio delay in audio playing.
We will use emulation
as an example to refer to the process of generating audio samples.
minimizing the buffer size will help minimize audio delay such as audio coming from an emulator. This is due to the fact that emulation speed does not always perfectly match the audio playing speed (e.g., 44100Hz).
A smaller buffer size can help maintain better synchronization, but it may cause noise or other issues on slower machines. This can occur if the emulation process is slow, or if a CPU-intensive process starts while the emulator is running.
Variants§
QuarterSecond
1/4 second worth of samples
HalfSecond
1/2 second worth of samples
OneSecond
1 second worth of samples
Samples(usize)
Number of samples to store Be careful, here you have to calculate based on the sample rate manually
Trait Implementations§
source§impl Clone for BufferSize
impl Clone for BufferSize
source§fn clone(&self) -> BufferSize
fn clone(&self) -> BufferSize
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more