The node works fine under Pytorch2.8 but fails on 2.9. I have fixed it by replacing
torchaudio.save(tmp_file.name, waveform, reference_audio["sample_rate"])
with
import soundfile as sf
audio = waveform.detach().CPU().numpy().squeeze()
if audio.ndim == 2 and audio.shape[0] in [1, 2]:
audio = audio.T
sf.write(
tmp_file.name,
audio,
reference_audio["sample_rate"]
)
Here is the new node.py
nodes.py
The node works fine under Pytorch2.8 but fails on 2.9. I have fixed it by replacing
torchaudio.save(tmp_file.name, waveform, reference_audio["sample_rate"])
with
import soundfile as sf
audio = waveform.detach().CPU().numpy().squeeze()
if audio.ndim == 2 and audio.shape[0] in [1, 2]:
audio = audio.T
sf.write(
tmp_file.name,
audio,
reference_audio["sample_rate"]
)
Here is the new node.py
nodes.py