fixed bug when both inputs are not tensors
This commit is contained in:
@@ -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]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user