Vocos is a fast neural vocoder for high-quality audio synthesis that generates Fourier spectral coefficients instead of directly modeling time-domain waveforms. It supports reconstruction from Mel spectrograms or EnCodec tokens, offering improved computational efficiency and audio quality compared to traditional time-domain methods. The library is currently at version 0.1.0 and is actively maintained with regular updates.
pip install vocosVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to load a pre-trained Vocos model and synthesize an audio waveform from a dummy Mel-spectrogram. It shows basic model instantiation, input preparation, and the decoding process.
Review the latest release notes and Hugging Face model cards for updated training configurations and hyperparameters. Consider re-evaluating your training scripts.
Ensure your `torchaudio` installation is compatible with your environment. For specific issues, consult `torchaudio` documentation or consider using a Linux-based environment for training if encountering persistent problems.
Ensure the `bandwidth_id` provided to the model's `decode` or `decode_from_codes` method is one of the supported values: `1.5`, `3.0`, `6.0`, or `12.0`. Pass it as a `torch.tensor` if required.
Be aware of the model's intended use. If targeting non-speech audio, conduct thorough evaluation of the output quality.
Install the library using `pip install vocos` or ensure the correct virtual environment where `vocos` is installed is activated.
Ensure both the model and all input tensors are on the same device. For example, move them to GPU with `.to('cuda')` or to CPU with `.to('cpu')`.Refer to the model's documentation or source code to determine the correct mapping for `bandwidth_id`. Typically, it will be an index (0-3) or the actual kbps value from the allowed set `[1.5, 3.0, 6.0, 12.0]`.
Experiment with the `mrd_loss_coeff` hyperparameter. Setting it to `1.0` from the start of training can help reduce 'buzziness' in the audio output, although it might slightly slow down convergence in terms of UTMOS score.