Views
No views yet
Abstract:
We propose WaveTrainerFit, a neural vocoder that performs high-quality waveform generation from data-driven features such as SSL features. WaveTrainerFit builds upon the WaveFit vocoder, which integrates diffusion model and generative adversarial network. Furthermore, the proposed method incorporates the following key improvements: 1. By introducing trainable priors, the inference process starts from noise close to the target speech instead of Gaussian noise. 2. Reference-aware gain adjustment is performed by imposing constraints on the trainable prior to matching the speech energy. These improvements are expected to reduce the complexity of waveform modeling from data-driven features, enabling high-quality waveform generation with fewer inference steps. Through experiments, we showed that WaveTrainerFit can generate highly natural waveforms with improved speaker similarity from data-driven features, while requiring fewer iterations than WaveFit. Moreover, we showed that the proposed method works robustly with respect to the depth at which SSL features are extracted.

[!IMPORTANT] ⚠️ License Notice: The model weights provided in this repository are licensed under different terms. Thexlsr*andwhisper*models are licensed differently from thewavlm*models. Please refer to the License section for details.
| Model-name | Conditional features | Layer num | #iters of model |
|---|---|---|---|
| wavlm2_wavetrainerfit5 | WavLM-large | 2 | 5 |
| wavlm2_wavefit5 | WavLM-large | 2 | 5 |
| wavlm8_wavetrainerfit5 | WavLM-large | 8 | 5 |
| wavlm8_wavefit5 | WavLM-large | 8 | 5 |
| wavlm24_wavetrainerfit5 | WavLM-large | 24 | 5 |
| wavlm24_wavefit5 | WavLM-large | 24 | 5 |
| xlsr8_wavetrainerfit5 | XLS-R-300m | 8 | 5 |
| xlsr8_wavefit5 | XLS-R-300m | 8 | 5 |
| whisper8_wavetrainerfit5 | ※ Whisper-medium | 8 | 5 |
| whisper8_wavefit5 | ※ Whisper-medium | 8 | 5 |
2.0-second segments → extracting features with the Whisper encoder → recombining → resynthesizing.
If you use this model in your application, the upstream feature extraction must also follow this flow.1import torchaudio
2import torch
3from wavetrainerfit import load_pretrained_vocoder
4from transformers import WavLMModel, AutoFeatureExtractor
5
6ssl_preprocessor = AutoFeatureExtractor.from_pretrained('microsoft/wavlm-large')
7ssl_model: WavLMModel = WavLMModel.from_pretrained('microsoft/wavlm-large')
8
9layer = 2
10ssl_vocoder, cfg = load_pretrained_vocoder(f'wavlm{layer}_wavetrainerfit5')
11waveform, sr = torchaudio.load('./assets/ljspeech-samples/LJ037-0171.wav')
12if sr != 16000:
13 waveform = torchaudio.transforms.Resample(
14 orig_freq=sr,
15 new_freq=16000
16 )(waveform)
17inputs = ssl_preprocessor(
18 waveform[0].numpy(),
19 sampling_rate=16000,
20 return_tensors="pt"
21)
22
23with torch.no_grad():
24 inputs = ssl_model(**inputs, output_hidden_states=True)
25 inputs = inputs.hidden_states[layer] # (Batch, Timeframe, Featuredim)
26 generated_waveform = ssl_vocoder.pred(
27 conditional_feature=inputs, # (Batch, Timeframe, Featuredim)
28 T_=5 # num of iteration
29 )
30
31torchaudio.save(
32 './assets/ljspeech-samples/LJ037-0171-reconstructed.wav',
33 generated_waveform[-1][:, 0].cpu(), 24000
34)wavlm* models: Licensed under CC BY-SA 3.0