audiofox 1.1.0

Cross platform audio capture made easy!
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

// SPDX-License-Identifier: GPL-2.0-or-later WITH Classpath-exception-2.0
// Audiofox, the audio capturer!
// Copyright (c) 2026 foxberries

#![allow(unused)]

/// The standard sample rate of the Audiofox library.
pub const SAMPLE_RATE: usize = 48000;

// The standard channel count of the Audiofox library.
pub const CHANNELS: usize = 2;

/// Calculate audio latency in ms given a number of frames. This does not account for
/// other sources of latency.
pub const fn latency(frames: usize) -> f32 {
    (frames as f32 / SAMPLE_RATE as f32) * 1000.0
}