27 releases (13 major breaking)
new 14.0.0 | May 9, 2025 |
---|---|
13.0.0 | Apr 7, 2025 |
12.0.0 | Apr 6, 2025 |
11.0.0 | Apr 6, 2025 |
0.1.2 | Dec 31, 2024 |
#391 in Audio
234 downloads per month
Used in 2 crates
53KB
1K
SLoC
shady-audio
is the audio backend for the other shady tools.
Its interface let's you easily fetch the frequency presence of the given audio source
by selecting an audio source which implemented the Fetcher
trait.
Example
use std::num::NonZero;
use shady_audio::{SampleProcessor, BarProcessor, BarProcessorConfig, fetcher::DummyFetcher};
let mut sample_processor = SampleProcessor::new(DummyFetcher::new());
let mut bar_processor = BarProcessor::new(
&sample_processor,
BarProcessorConfig {
amount_bars: NonZero::new(20).unwrap(),
..Default::default()
}
);
let mut bar_processor2 = BarProcessor::new(
&sample_processor,
BarProcessorConfig {
amount_bars: NonZero::new(10).unwrap(),
..Default::default()
}
);
loop {
// the sample processor needs to compute the new samples only once
// for both bar processors (to reduce computation)
sample_processor.process_next_samples();
let bars = bar_processor.process_bars(&sample_processor);
let bars2 = bar_processor2.process_bars(&sample_processor);
assert_eq!(bars.len(), 20);
assert_eq!(bars2.len(), 10);
break;
}
Dependencies
~7–35MB
~513K SLoC