This removes the use of AGC's experimental atomic bool controls in
favor of the already stable periodic_access method of control.
The disadvantage is that periodic_access is significantly more difficult
for most users to undestand. It requires understanding of how closures
work with ownership and threading primitives like Atomics & Arc.
- Replace static parameters with AtomicF32 for thread-safe access
- Add methods to get Arc<AtomicF32> for release_coeff, attack_coeff, absolute_max_gain, and target_level
- Enable real-time modification of AGC parameters during playback
- Use Ordering::Relaxed for optimal low-latency performance
- Remove set_* methods in favor of direct atomic access
- Update internal methods to use atomic loads consistently
This change allows for dynamic adjustment of AGC parameters
without interrupting audio playback, improving real-time control
and responsiveness of the Automatic Gain Control system.
Benchmarks use the music.wav file, we use *divan* as benchmark harnass.
The time needed to load the wav file is excluded from the benchmark
by preparing the data into a special test Source. That source also
enables converting between formats.
In the future *divan* will add support for structured (json) output.
Then we could integrate with the bencher service to generate benchmark
reports for all PR's and keep a timeseries of performance.
Specifically cpal changed `SupportedStreamConfigRange` and made it Copy.
As that relaxes the requirements on it its a non breaking change. Rodio was
then refactored to remove the now no longer needed `.clone()` in 77c5c54. That
clone however is still needed for Rodio users with a lower cpal version. This
commit fixes that by requiring a higher cpal version.
This adds two dependencies, they are only needed for the test suite.
Compile time will not increase for users. The extra overhead when
running the test suite is worth it imho. The test file is significantly
shorter and there is less code duplication. A run time solution would
decrease the test interface (you would have to manually find out which
params caused the test).