From df5fc6f82071f5eb2d28a9cedb2bd4e5133090b1 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Wed, 17 Oct 2018 15:55:42 +0200 Subject: Add dB test + long awaited README --- README.md | 36 ++++++++++++++++++++++++++++++++++++ src/parsing/mod.rs | 2 ++ src/utils.rs | 13 +++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..7902bae --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# set_eq: A command-line tool to manipulate PulseAudio's equalizers + +This tool will allow you to use a configuration file to send to your favorite +PulseAudio's equalizer. + +It was originally made to work with +[AutoEq](https://github.com/jaakkopasanen/AutoEq)'s +[database](https://github.com/jaakkopasanen/AutoEq/tree/master/results), but if +you have ideas on how to extend `set_eq`'s domain, please start a discussion in +a new issue! + +Supported configuration format: + +- EqualizerAPO (very partial) + +Supported equalizer: + +- PulseAudio's built-in equalizer (deprecated and buggy, should not use) +- PulseEffects + +## Quick start + +- Install [PulseEffects](https://github.com/wwmm/pulseeffects) +- Find or create an EqualizerAPO configuration file + - If you have a some headphones, try to find it + [here](https://github.com/jaakkopasanen/AutoEq/tree/master/results) + and either download the ` GraphicEQ.txt` file or save the + EqualizerAPO snippet from the README +- Run the following command: + +``` +set_eq pa-effects export-preset > MyPreset.json +``` + +- Load the new preset in PulseEffects' interface +- Profit! diff --git a/src/parsing/mod.rs b/src/parsing/mod.rs index 3aedb2c..4454b04 100644 --- a/src/parsing/mod.rs +++ b/src/parsing/mod.rs @@ -2,3 +2,5 @@ pub mod equalizer_apo; pub use self::equalizer_apo::MainParser as EqualizerApoParser; + +// TODO: test parsing filters with real examples diff --git a/src/utils.rs b/src/utils.rs index 24df0ce..b966a3b 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -85,3 +85,16 @@ fn introspect(conn: &dbus::ConnPath<&Connection>) { println!("{}", thing.iter_init().read::().unwrap()); } */ + +#[cfg(test)] +mod tests { + + #[test] + fn decibel_to_ratio() { + assert_eq!(super::decibel_to_ratio(0f64), 1f64); + assert_eq!(super::decibel_to_ratio(20f64), 10f64); + assert_eq!(super::decibel_to_ratio(40f64), 100f64); + assert_eq!(super::decibel_to_ratio(60f64), 1000f64); + } + +} -- cgit v1.2.3