Skip to content

Commit

Permalink
Torchaudio loading; windows testing
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrmorrison committed Jun 17, 2024
1 parent 1c002b6 commit e2c3058
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
Empty file added 1.6
Empty file.
10 changes: 8 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
13 changes: 4 additions & 9 deletions torchcrepe/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down

0 comments on commit e2c3058

Please sign in to comment.