Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .rustfmt.toml

This file was deleted.

16 changes: 8 additions & 8 deletions examples/limit_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ fn main() {
println!("Example 5: Comparing different limiting scenarios");

let gentle_limiting = LimitSettings::default()
.with_threshold(-6.0) // Higher threshold (less limiting)
.with_knee_width(8.0) // Wide knee (softer)
.with_attack(Duration::from_millis(20)) // Slower attack
.with_threshold(-6.0) // Higher threshold (less limiting)
.with_knee_width(8.0) // Wide knee (softer)
.with_attack(Duration::from_millis(20)) // Slower attack
.with_release(Duration::from_millis(200)); // Slower release

let aggressive_limiting = LimitSettings::default()
.with_threshold(-1.0) // Lower threshold (more limiting)
.with_knee_width(1.0) // Narrow knee (harder)
.with_attack(Duration::from_millis(2)) // Fast attack
.with_threshold(-1.0) // Lower threshold (more limiting)
.with_knee_width(1.0) // Narrow knee (harder)
.with_attack(Duration::from_millis(2)) // Fast attack
.with_release(Duration::from_millis(20)); // Fast release

println!(" Gentle limiting:");
Expand Down Expand Up @@ -109,8 +109,8 @@ fn main() {
// Apply limiting with -6dB threshold (should limit to ~0.5)
let strict_limiting = LimitSettings::default()
.with_threshold(-6.0)
.with_knee_width(0.5) // Narrow knee for precise limiting
.with_attack(Duration::from_millis(3)) // Fast attack
.with_knee_width(0.5) // Narrow knee for precise limiting
.with_attack(Duration::from_millis(3)) // Fast attack
.with_release(Duration::from_millis(12)); // Moderate release

let limited_sine = test_sine.limit(strict_limiting.clone());
Expand Down
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
edition = "2021"
3 changes: 2 additions & 1 deletion src/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ impl Sink {
*to_clear -= 1;
*controls.position.lock().unwrap() = Duration::ZERO;
} else {
*controls.position.lock().unwrap() = src.inner().inner().inner().inner().get_pos();
*controls.position.lock().unwrap() =
src.inner().inner().inner().inner().get_pos();
}
}
let amp = src.inner_mut().inner_mut();
Expand Down
4 changes: 2 additions & 2 deletions src/source/limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ impl LimitSettings {
#[inline]
pub fn broadcast() -> Self {
Self::default()
.with_knee_width(2.0) // Narrower knee for decisive limiting
.with_attack(Duration::from_millis(3)) // Faster attack for transients
.with_knee_width(2.0) // Narrower knee for decisive limiting
.with_attack(Duration::from_millis(3)) // Faster attack for transients
.with_release(Duration::from_millis(50)) // Faster recovery for consistency
}

Expand Down
2 changes: 1 addition & 1 deletion tests/limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn test_limiting_works() {
.take_duration(Duration::from_millis(60)); // ~2600 samples

let settings = rodio::source::LimitSettings::default()
.with_threshold(-6.0) // -6dB = ~0.5 linear
.with_threshold(-6.0) // -6dB = ~0.5 linear
.with_knee_width(0.5)
.with_attack(Duration::from_millis(3))
.with_release(Duration::from_millis(12));
Expand Down