Skip to content

Commit

Permalink
Merge pull request #180 from yalishanda42/main
Browse files Browse the repository at this point in the history
Only pass str to torchaudio.info(...)
  • Loading branch information
iver56 authored Nov 8, 2024
2 parents 02aaf0b + 657bf44 commit c54e035
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions torch_audiomentations/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ def rms_normalize(samples: Tensor) -> Tensor:
return samples / (rms + 1e-8)

@staticmethod
def get_audio_metadata(file_path) -> tuple:
def get_audio_metadata(file_path: Union[str, Path]) -> tuple:
"""Return (num_samples, sample_rate)."""
info = torchaudio.info(file_path)
info = torchaudio.info(str(file_path))
# Deal with backwards-incompatible signature change.
# See https://github.com/pytorch/audio/issues/903 for more information.
if type(info) is tuple:
Expand Down

0 comments on commit c54e035

Please sign in to comment.