Skip to content

Commit

Permalink
Add automatic_gain_control to Cargo.toml examples
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownSuperficialNight committed Oct 6, 2024
1 parent 0b20274 commit ee980bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@ required-features = ["symphonia-isomp4", "symphonia-aac"]
[[example]]
name = "noise_generator"
required-features = ["noise"]

[[example]]
name = "automatic_gain_control"
required-features = ["dep:atomic_float"]
4 changes: 1 addition & 3 deletions examples/automatic_gain_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ fn main() {
let agc_source = source.automatic_gain_control(1.0, 4.0, 0.005, 5.0);

// Get a handle to control the AGC's enabled state (only when using experimental feature)
#[cfg(feature = "experimental")]
let agc_control = agc_source.get_agc_control();

// Disable AGC by default when using experimental feature
#[cfg(feature = "experimental")]
agc_control.store(false, std::sync::atomic::Ordering::Relaxed);
agc_control.store(true, std::sync::atomic::Ordering::Relaxed);

// Add the AGC-processed source to the sink for playback
sink.append(agc_source);
Expand Down

0 comments on commit ee980bc

Please sign in to comment.