Skip to content

ChatterBox Voice TTS does not work on PyTorch2.9+ (FIX INCLUDED) #16

@PhillLittlewood

Description

@PhillLittlewood

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions