Add files via upload

This commit is contained in:
Anjok07 2023-10-16 23:11:50 -05:00 committed by GitHub
parent df5092f9f7
commit 42295b09bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -35,9 +35,11 @@ else:
if OPERATING_SYSTEM == 'Darwin':
wav_resolution = "polyphase" if SYSTEM_PROC == ARM or ARM in SYSTEM_ARCH else "sinc_fastest"
wav_resolution_float_resampling = "kaiser_best" if SYSTEM_PROC == ARM or ARM in SYSTEM_ARCH else wav_resolution
is_macos = True
else:
wav_resolution = "sinc_fastest"
wav_resolution_float_resampling = wav_resolution
MAX_SPEC = 'Max Spec'
MIN_SPEC = 'Min Spec'
@ -714,7 +716,7 @@ def change_pitch_semitones(y, sr, semitone_shift):
factor = 2 ** (semitone_shift / 12) # Convert semitone shift to factor for resampling
y_pitch_tuned = []
for y_channel in y:
y_pitch_tuned.append(librosa.resample(y_channel, sr, sr*factor, res_type=wav_resolution))
y_pitch_tuned.append(librosa.resample(y_channel, sr, sr*factor, res_type=wav_resolution_float_resampling))
y_pitch_tuned = np.array(y_pitch_tuned)
new_sr = sr * factor
return y_pitch_tuned, new_sr

View File

@ -1,7 +1,6 @@
import torch
import torch.nn as nn
from functools import partial
import torch_directml
class STFT:
def __init__(self, n_fft, hop_length, dim_f, device):
@ -53,7 +52,6 @@ class STFT:
return x
def get_norm(norm_type):
def norm(c, norm_type):
if norm_type == 'BatchNorm':