firewheel_core/
lib.rs

1pub mod atomic_float;
2pub mod channel_config;
3pub mod clock;
4pub mod collector;
5pub mod diff;
6pub mod dsp;
7pub mod event;
8pub mod node;
9pub mod param;
10pub mod sample_resource;
11pub mod sync_wrapper;
12
13mod silence_mask;
14
15use core::num::NonZeroU32;
16
17pub use silence_mask::SilenceMask;
18
19extern crate self as firewheel_core;
20
21/// Information about a running audio stream.
22#[derive(Debug, Clone, PartialEq)]
23pub struct StreamInfo {
24    pub sample_rate: NonZeroU32,
25    /// The reciprocal of the sample rate.
26    pub sample_rate_recip: f64,
27    pub max_block_frames: NonZeroU32,
28    pub num_stream_in_channels: u32,
29    pub num_stream_out_channels: u32,
30    /// The latency of the input to output stream in seconds.
31    pub input_to_output_latency_seconds: f64,
32    pub declick_frames: NonZeroU32,
33    /// The name of the input audio device.
34    pub input_device_name: Option<String>,
35    /// The name of the output audio device.
36    pub output_device_name: Option<String>,
37}
38
39impl Default for StreamInfo {
40    fn default() -> Self {
41        Self {
42            sample_rate: NonZeroU32::new(44100).unwrap(),
43            sample_rate_recip: 44100.0f64.recip(),
44            max_block_frames: NonZeroU32::new(1024).unwrap(),
45            num_stream_in_channels: 0,
46            num_stream_out_channels: 2,
47            input_to_output_latency_seconds: 0.0,
48            declick_frames: NonZeroU32::MIN,
49            input_device_name: None,
50            output_device_name: None,
51        }
52    }
53}
54
55#[cfg(feature = "symphonium")]
56pub use sample_resource::{load_audio_file, load_audio_file_from_source};