From eda60e2c35660d1a05176c4c7eaae3bb86516a81 Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Wed, 1 Jun 2022 15:15:16 -0400 Subject: [PATCH] refactor: use named arguments, remove frames_to_time() --- readalongs/align.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/readalongs/align.py b/readalongs/align.py index 2ce42f1d..0d26ee77 100644 --- a/readalongs/align.py +++ b/readalongs/align.py @@ -571,9 +571,6 @@ def align_audio( # soundswallower, which are indexes in frames, into durations in seconds. frame_size = 1.0 / asr_config.get_int("-frate") - def frames_to_time(frames: int) -> float: - return frames * frame_size - # Get list of words to ignore in aligner output noisewords = read_noisedict(asr_config) @@ -598,7 +595,11 @@ def frames_to_time(frames: int) -> float: ) # Adjust alignments for DNA aligned_words = adjust_dna_segmentation( - segmentation, curr_removed_segments, noisewords, frame_size, debug_aligner + segmentation=segmentation, + curr_removed_segments=curr_removed_segments, + noisewords=noisewords, + frame_size=frame_size, + debug_aligner=debug_aligner, ) results["words"].extend(aligned_words) if aligned_words: