Skip to content

Commit

Permalink
refactor: use named arguments, remove frames_to_time()
Browse files Browse the repository at this point in the history
  • Loading branch information
dhdaines committed Jun 1, 2022
1 parent 9e33ecb commit eda60e2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions readalongs/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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:
Expand Down

0 comments on commit eda60e2

Please sign in to comment.