Skip to content

Commit

Permalink
Add exception handler
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisn committed May 15, 2024
1 parent 2e948a3 commit 33b4c33
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions audio_offset_finder/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,14 @@ def main(argv):
args = parser.parse_args(argv)
if not (args.find_offset_of and args.within):
parser.error("Please provide input audio files")
results = find_offset_between_files(
args.within, args.find_offset_of, fs=int(args.sr), trim=int(args.trim), hop_length=int(args.resolution)
)

try:
results = find_offset_between_files(
args.within, args.find_offset_of, fs=int(args.sr), trim=int(args.trim), hop_length=int(args.resolution)
)
except Exception as e:
print(e, file=sys.stderr)
return 1

if args.output_json:
import json
Expand Down

0 comments on commit 33b4c33

Please sign in to comment.