diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-10-12 14:44:33 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-10-12 14:44:33 +0200 |
| commit | 1e39e0d283ad06a4a8212abbe2c817eb6e3f5b91 (patch) | |
| tree | 619d266f1b0103b719d0cce89c39112aea48450b /animism-align/cli/commands/peaks | |
| parent | ac03ba9a645066acfda0449a879034531bb6cee3 (diff) | |
toggle script
Diffstat (limited to 'animism-align/cli/commands/peaks')
| -rw-r--r-- | animism-align/cli/commands/peaks/parse.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/animism-align/cli/commands/peaks/parse.py b/animism-align/cli/commands/peaks/parse.py index b6a9f82..f5b36a4 100644 --- a/animism-align/cli/commands/peaks/parse.py +++ b/animism-align/cli/commands/peaks/parse.py @@ -5,7 +5,7 @@ Extract peaks from an MP3 file. import click @click.command() -@click.option('-i', '--input', 'fp_in', required=False, +@click.option('-i', '--input', 'fp_in', required=True, help='Input file') @click.pass_context def cli(ctx, fp_in): @@ -19,6 +19,10 @@ def cli(ctx, fp_in): from app.settings import app_cfg + if not os.path.exists(fp_in): + print(f"fp_in does not exist: {fp_in}") + return + print(f"Loading {fp_in}") y, sr = librosa.load(fp_in, sr=None) @@ -36,3 +40,5 @@ def cli(ctx, fp_in): with open(os.path.join(app_cfg.DIR_DATA_STORE, 'peaks/peaks.json'), 'w') as fp_out: json.dump(peaks.tolist(), fp_out, separators=(',', ':')) + + print("Wrote peaks.json") |
