Skip to content

Commit

Permalink
fix array transposition
Browse files Browse the repository at this point in the history
  • Loading branch information
Flux9665 committed Jun 29, 2024
1 parent 7bc24a4 commit e040260
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Architectures/Aligner/CodecAlignerDataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ def _cache_builder_process(self,
print(f"Problem with an audio file: {path}")
continue

if len(wave.shape) > 1: # the audio is in stereo, so we need to merge the channels.
if len(wave[0]) == 2: # let's figure out whether the axes are switched, which seems to be the case sometimes
wave = wave.transpose() # if yes, we switch the axes into the order librosa's to_mono function expects.
wave = librosa.to_mono(wave)

if sr != assumed_sr:
Expand Down

0 comments on commit e040260

Please sign in to comment.