diff --git a/1.6 b/1.6 new file mode 100644 index 0000000..e69de29 diff --git a/setup.py b/setup.py index 66095c5..6d42e15 100644 --- a/setup.py +++ b/setup.py @@ -8,11 +8,17 @@ setup( name='torchcrepe', description='Pytorch implementation of CREPE pitch tracker', - version='0.0.22', + version='0.0.23', author='Max Morrison', author_email='maxrmorrison@gmail.com', url='https://github.com/maxrmorrison/torchcrepe', - install_requires=['librosa>=0.9.1', 'resampy', 'scipy', 'torch', 'tqdm'], + install_requires=[ + 'librosa>=0.9.1', + 'resampy', + 'scipy', + 'torch', + 'torchaudio', + 'tqdm'], packages=['torchcrepe'], package_data={'torchcrepe': ['assets/*']}, long_description=long_description, diff --git a/torchcrepe/load.py b/torchcrepe/load.py index 32573c3..8f6a0be 100644 --- a/torchcrepe/load.py +++ b/torchcrepe/load.py @@ -2,20 +2,15 @@ import numpy as np import torch -import torchcrepe +import torchaudio from scipy.io import wavfile +import torchcrepe + def audio(filename): """Load audio from disk""" - sample_rate, audio = wavfile.read(filename) - - # Convert to float32 - if audio.dtype == np.int16: - audio = audio.astype(np.float32) / np.iinfo(np.int16).max - - # PyTorch is not compatible with non-writeable arrays, so we make a copy - return torch.tensor(np.copy(audio))[None], sample_rate + return torchaudio.load(filename) def model(device, capacity='full'):