fixed bug when both inputs are not tensors

This commit is contained in:
Jaikinator
2023-09-08 08:30:10 +02:00
parent 2643d7999b
commit 1750e551f6
+3
View File
@@ -98,6 +98,9 @@ class AudioProcessor:
""" """
start = int(start * self.sr) start = int(start * self.sr)
if (isinstance(end, float) or isinstance(end, int)) and isinstance(self.sr, int):
end = int(np.ceil(end * self.sr))
else:
end = int(torch.ceil(end * self.sr)) end = int(torch.ceil(end * self.sr))
return self.waveform[start:end] return self.waveform[start:end]