Synthesizing Audio with Generative Adversarial Networks

Chris Donahue, Julian J. McAuley, Miller S. Puckette

Abstract

Audio signals are sampled at high temporal resolutions, and learning to synthesize audio requires capturing structure across a range of timescales. Generative adversarial networks (GANs) have seen wide success at generating images that are both locally and globally coherent, but they have seen little application to audio generation. In this paper we introduce WaveGAN, a first attempt at applying GANs to unsupervised synthesis of raw-waveform audio. WaveGAN is capable of synthesizing one second slices of audio waveforms with global coherence, suitable for sound effect generation. Our experiments demonstrate that, without labels, WaveGAN learns to produce intelligible words when trained on a small-vocabulary speech dataset, and can also synthesize audio from other domains such as drums, bird vocalizations, and piano. We compare WaveGAN to a method which applies GANs designed for image generation on image-like audio feature representations, finding both approaches to be promising.

Introduction

Generating high-fidelity audio presents a significant computational challenge. Unlike images, which are relatively low-resolution (e.g., a 64x64 image contains 4,096 pixels), one second of audio at a modest 16kHz sample rate contains 16,000 data points. Furthermore, audio contains structure across vastly different timescales—from the micro-level of timbre (milliseconds) to the macro-level of words or musical phrases (seconds).

Existing state-of-the-art models, such as WaveNet, typically rely on autoregression, generating audio one sample at a time. While high-quality, this process is computationally expensive and slow. WaveGAN explores a parallel alternative using Generative Adversarial Networks (GANs) to generate entire chunks of raw audio data at once, adapting architectures originally designed for the spatial properties of 2D images to the temporal, periodic nature of 1D audio.

Methodology

The researchers proposed two primary strategies for audio synthesis:

  1. WaveGAN (The Waveform Approach): This model adapts the DCGAN architecture by "flattening" 2D convolutions into 1D. To account for the high resolution of audio, the filter length was increased (from 5 to 25) and the stride factor was expanded (from 2 to 4).
  2. SpecGAN (The Spectrogram Approach): This treats audio as an image by converting it into a log-magnitude spectrogram. A standard 2D DCGAN generates these "images," which are then converted back into audio using the Griffin-Lim algorithm.

The "Phase Shuffle" Innovation

A major contribution of this work is the introduction of Phase Shuffle. In image GANs, upsampling often creates "checkerboard artifacts." In the 1D audio domain, these manifest as distinct, periodic high-pitched noises. A discriminator can easily learn to identify these artifacts to distinguish real from synthetic data, preventing the generator from learning the true distribution. Phase Shuffle randomly shifts the phase of the discriminator's activations, forcing it to ignore these trivial periodic artifacts and focus on the underlying signal.

Figure 6: Comparison of upsampling artifacts in 2D (images) vs 1D (audio) and the application of Phase Shuffle to mitigate periodic noise.

Experimental Setup

The models were evaluated on several diverse datasets to test their versatility:

  • SC09 (Speech Commands Zero Through Nine): One-second clips of spoken digits, serving as the "MNIST of audio."
  • Drum Sound Effects: 0.7 hours of kicks, snares, and cymbals.
  • Bird Vocalizations: 12.2 hours of various species recordings.
  • Piano: 0.3 hours of Bach compositions.
  • TIMIT: A large-vocabulary speech dataset used to test multi-speaker complexity.

Analysis and Results

Audio vs. Image Features

PCA analysis reveals a fundamental difference between the domains: while image components are based on gradients and edges, the building blocks of audio are periodic waves. This justifies the need for wider receptive fields and longer filters in WaveGAN compared to standard image GANs.

Figure 3: Visualization of local patches and filters, highlighting the periodic nature of audio features compared to the edge-based features of images.

Performance and Speed

WaveGAN's primary advantage is efficiency; it can generate an hour of audio in less than two seconds on a single GPU, several orders of magnitude faster than autoregressive models. While SpecGAN often achieved better quantitative Inception Scores, human listeners preferred WaveGAN. The process of spectrogram inversion in SpecGAN is lossy and often introduces unpleasant artifacts.

On the SC09 dataset, human annotators correctly identified digits in WaveGAN-generated audio 58% of the time (vs. 10% for random chance). Furthermore, the model successfully learned to produce distinct drum types and intelligible words without any supervised labels, indicating it captured the underlying latent space of the data.

Conclusion

WaveGAN demonstrates that GANs can successfully synthesize raw audio waveforms with global coherence in an unsupervised manner. While the model is currently limited to one-second slices and exhibits some background hiss, its speed and ability to learn semantic categories are promising. Future work may explore conditional WaveGANs or methods to extend the duration of coherent sequences.

Summary updated

BibTeX
@inproceedings{donahue2019synthesizing,
  author = {Chris Donahue and Julian J. McAuley and Miller S. Puckette},
  title = {{Synthesizing Audio with Generative Adversarial Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2019},
  url = {https://openreview.net/forum?id=PsDIRxrLt7},
}
Figure