diff --git a/README.md b/README.md index 36efee0..76c8c3c 100644 --- a/README.md +++ b/README.md @@ -497,20 +497,20 @@ Create a comparative plot of multiple audio waves. Useful for comparing the effe ``` vmh plot compare-waves --help - - Usage: vmh plot compare-waves [OPTIONS] FILES... FIG_NAME [FORCE_DB] + + Usage: vmh plot compare-waves [OPTIONS] FILES... FIG_NAME Plot a figure with N audio waves for comparison. -╭─ Arguments ───────────────────────────────────────────────────────────────────────╮ -│ * files FILES... [default: None] [required] │ -│ * fig_name TEXT [default: None] [required] │ -│ force_db [FORCE_DB] Force to use 1 to -1 dbs in plot [default: True] │ -╰───────────────────────────────────────────────────────────────────────────────────╯ -╭─ Options ─────────────────────────────────────────────────────────────────────────╮ -│ --fig-size ... [default: 10, 12] │ -│ --help Show this message and exit. │ -╰───────────────────────────────────────────────────────────────────────────────────╯ +╭─ Arguments ────────────────────────────────────────────────────────────────────────────────────────────╮ +│ * files FILES... [default: None] [required] │ +│ * fig_name TEXT [default: None] [required] │ +╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────╮ +│ --fig-size ... [default: 10, 12] │ +│ --force-db --no-force-db Force to use 1 to -1 dbs in plot [default: force-db] │ +│ --help Show this message and exit. │ +╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` ### All options diff --git a/examples/cut-video/README.md b/examples/cut-video/README.md index 5f45ef6..9960155 100644 --- a/examples/cut-video/README.md +++ b/examples/cut-video/README.md @@ -17,6 +17,19 @@ Some examples, changing the `distance` parameter. ![example](./out.png) +CLI to generate this image: +```bash +vmh plot compare-waves \ + examples/cut-video/default.mkv \ + examples/cut-video/result_large.mp4 \ + examples/cut-video/result_medium.mp4 \ + examples/cut-video/result_small.mp4 \ + examples/cut-video/result_tiny.mp4 \ + examples/cut-video/result_negative.mp4 \ + examples/cut-video/out.png \ + --no-force-db +``` + All these examples using defaults parameters to `threshold`, `silence-time`, `bitrate` and `codec`. The `--preset` used is `ultrafast` diff --git a/examples/cut-video/out.png b/examples/cut-video/out.png index 183246d..3e99080 100644 Binary files a/examples/cut-video/out.png and b/examples/cut-video/out.png differ diff --git a/vmh/plot.py b/vmh/plot.py index bb1049a..2e4d307 100644 --- a/vmh/plot.py +++ b/vmh/plot.py @@ -1,7 +1,7 @@ import matplotlib.pyplot as plt from librosa import load from librosa.display import waveshow -from typer import Typer, Argument +from typer import Typer, Option plot = Typer(no_args_is_help=True) @@ -20,7 +20,7 @@ def compare_waves( files: list[str], fig_name: str, fig_size: tuple[float, float] = (10, 12), - force_db: bool = Argument(True, help='Force to use 1 to -1 dbs in plot'), + force_db: bool = Option(True, help='Force to use 1 to -1 dbs in plot'), ) -> None: """Plot a figure with N audio waves for comparison.""" _, ax = plt.subplots(