Skip to content

Commit

Permalink
Merge pull request #23 from will-rice/wr-mono-audio
Browse files Browse the repository at this point in the history
update README to reflect mono audio
  • Loading branch information
will-rice authored Mar 12, 2024
2 parents d04b117 + 15f0371 commit cd3c983
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ audio, sr = torchaudio.load("noisy_audio.wav")
if sr != model.config.sample_rate:
audio = torchaudio.functional.resample(audio, sr, model.config.sample_rate)

if audio.size(0) > 1:
audio = audio.mean(0, keepdim=True)

chunk_size = model.config.max_length

padding = abs(audio.size(-1) % chunk_size - chunk_size)
Expand Down

0 comments on commit cd3c983

Please sign in to comment.