Skip to main content

WaveGlow Vocoder

A vocoder that can convert audio to Mel-Spectrogram and reverse with WaveGlow, all on GPU.
Most code is from Tacotron2 and WaveGlow.

Install

pip install waveglow-vocoder

Example

Original Vocoded
img img
original music vocoded music
img img
original speech vocoded speech

Usage

Load wav file as torch tensor on GPU.

import librosa

y,sr = librosa.load(librosa.util.example_audio_file(), sr=22050, mono=True, duration=10, offset=30)
y_tensor = torch.from_numpy(y).to(device='cuda', dtype=torch.float32)

Apply mel transform, this would be done on GPU(if ava).

from waveglow_vocoder import WaveGlowVocoder

WV = WaveGlowVocoder()
mel = WV.wav2mel(y_tensor)

Decoder it with Waveglow.

NOTE:
As the hyperparameter of pre-trained model is alignment with Tacotron2, one might get totally noise if the Mel spectrogram comes from other function than wav2mel(an alias for TacotronSTFT.mel_spectrogram).
Support for the melspectrogram from librosa and torchaudio is under development.

wav = WV.mel2wav(mel)

Other pretrained model / Train with your own data

This vocoder will download pre-trained model from pytorch hub on the first time of initialize.
You can also download the latest model from WaveGlow, or with your own data and pass the path to the waveglow vocoder.

config_path = "your_config_of_model_training.json"
waveglow_path="your_model_path.pt"
WV = WaveGlowVocoder(waveglow_path=waveglow_path, config_path=config_path)

Then use it as usual.

TODO

  • WaveRNN Vocoder
  • MelGAN Vocoder
  • Performance
  • Support librosa Mel input

Reference

Metadata

Release files for waveglow-vocoder 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for waveglow-vocoder 0.2.1
File Size Uploaded Provenance Actions
waveglow_vocoder-0.2.1.tar.gz 11.9 kB Without provenance Details for waveglow_vocoder-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for waveglow-vocoder 0.2.1
File Interpreter ABI Platform Actions
waveglow_vocoder-0.2.1-py3.7.egg Legacy Egg format - - Details for waveglow_vocoder-0.2.1-py3.7.egg

Total release size: 35.4 kB

Release files / waveglow_vocoder-0.2.1.tar.gz

Download URL waveglow_vocoder-0.2.1.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1c0f13f0eefe0c0c13c05ceb59c5838bd1ebad81aa6b2363e6f1562d05f6efe3
BLAKE2b-256 checksum
How to use checksums
4dfebc0f9e3f8152b0ee85c2ee39c297321aed9fad74740497001be569318284
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release files / waveglow_vocoder-0.2.1-py3.7.egg

Download URL waveglow_vocoder-0.2.1-py3.7.egg
Size 23.5 kB
Tags Egg
SHA-256 checksum
How to use checksums
6d2b73be85174fcc95b390453abab9106b78c034cb4b1b6ab010ca18434c6ee0
BLAKE2b-256 checksum
How to use checksums
127515441b9ec9c97e63b8a1cc050ee362397720edeef5b1f0aa30cdc87cd946
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Security for waveglow-vocoder 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page