blob: 4fd63789d27793e5ce99d3ef83583456b933ad73 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
"""
Extract peaks from an MP3 file.
"""
import click
@click.command()
@click.option('-i', '--input', 'fp_in', required=True,
help='Input file')
@click.pass_context
def cli(ctx, fp_in):
"""Extract peaks from an audio file.
"""
from app.peaks import extract_peaks
peaks = extract_peaks(fp_in)
with open(os.path.join(app_cfg.DIR_DATA_STORE, 'peaks/peaks.json'), 'w') as fp_out:
json.dump(peaks, fp_out, separators=(',', ':'))
print("Wrote peaks.json")
|