ΟΔΗΓΟΣ Audio AI

SoundStream Neural Audio Codec

SoundStream is a neural audio codec from Google Research, published in July 2021, that compresses speech, music and general audio with a learned encoder, a residual vector quantizer and a learned decoder.

Ακούστε αυτόν τον οδηγόαφήγηση με AI · ~8 min

Σε αυτήν τη σελίδα9 min read
  1. Επισκόπηση
  2. Βασικά takeaways
  3. Βαθιά κατάδυση
  4. Working out SoundStream's bitrate from its settings
  5. Υλοποίηση σε πραγματικό κόσμο
  6. The Future of SoundStream Neural Audio Codec
  7. Κάνοντάς το στην πράξη
  8. Πηγές και περαιτέρω ανάγνωση
  9. Συνεχίστε την εξερεύνηση
  10. Συχνές ερωτήσεις

Επισκόπηση

In listening tests it matched or beat traditional codecs at a fraction of their bitrate, and its discrete codes became a standard way to turn audio into tokens for generative models.

Βασικά takeaways

  1. SoundStream is a Google Research neural audio codec from July 2021 that uses a convolutional encoder, residual vector quantization and a convolutional decoder.
  2. Its encoder turns 24 kHz audio into 75 embeddings per second, and each embedding is sent as a short list of codebook indices.
  3. Quantizer dropout lets one SoundStream model run anywhere from 3 to 18 kbps by using more or fewer quantizer layers.
  4. In listening tests SoundStream at 3 kbps outperformed Opus at 12 kbps and approached EVS at 9.6 kbps.
  5. Google's Lyra V2 codec and AudioLM generator both build on SoundStream, the first for calls and the second for audio tokens.

Βαθιά κατάδυση

A codec, short for coder-decoder, is software that shrinks audio for sending or storage and rebuilds it on the other side. Traditional speech codecs such as Opus and EVS are designed by hand using signal processing and models of human hearing. SoundStream, described by Neil Zeghidour, Alejandro Luebs, Ahmed Omran, Jan Skoglund and Marco Tagliasacchi of Google Research in a July 2021 paper, replaces those hand-built parts with neural networks trained end to end. It handles speech, music and general audio with one model and can stream, meaning it encodes and decodes as audio arrives rather than waiting for a whole file.

The pipeline has three parts. An encoder, a stack of one-dimensional convolutional layers, reads the raw waveform sampled at 24 kHz and downsamples it with strides of 2, 4, 5 and 8, producing one embedding vector for every 320 samples. That is 75 vectors per second, one every 13.3 milliseconds. A quantizer then replaces each vector with a short list of codebook indices, which is what actually gets transmitted. A decoder, built like the encoder in reverse with transposed convolutions, turns the indices back into a waveform. All three are trained together so that the output sounds like the input.

The quantizer is the key idea. Vector quantization maps a vector to the nearest entry in a learned codebook and sends only that entry's number. The paper shows why plain vector quantization fails at useful bitrates: at 6 kbps and 75 frames per second each frame gets 80 bits, which would require a codebook of 2 to the power 80 entries. SoundStream instead uses residual vector quantization (RVQ). The first quantizer picks the closest codebook entry, the difference between the vector and that entry, called the residual, goes to a second quantizer, its residual goes to a third, and so on. With 8 quantizers of 1,024 entries each, every quantizer spends 10 bits and the total is 80 bits per frame, using only 8,192 stored vectors in total.

Training combines two kinds of loss. A reconstruction loss compares spectrograms of the input and output at several time-frequency resolutions, and a feature loss compares how the discriminators respond to real and decoded audio. Adversarial losses come from discriminators, networks trained to tell real audio from decoded audio, which push the decoder toward natural-sounding output rather than a blurry average. A technique called quantizer dropout makes the bitrate adjustable: during training, the model randomly uses only the first n quantizers, so a single trained model can later run anywhere from 3 to 18 kbps, and the authors report negligible quality loss compared with models trained for one fixed bitrate.

The headline results come from crowd-sourced listening tests inspired by MUSHRA, a standard method in which listeners rate several versions of a clip against a hidden reference. On 200 clips of clean speech, noisy speech, reverberant speech and music, each rated 20 times, SoundStream at 3 kbps outperformed Opus at 12 kbps and approached EVS at 9.6 kbps, which Google's blog post describes as using 3.2 to 4 times fewer bits. The model also proved fast: on a single CPU thread of a Pixel 4 phone, the default configuration ran more than 2.3 times faster than real time, and a smaller version more than 7.1 times. Training used LibriTTS for clean speech, LibriTTS mixed with Freesound noise for noisy speech, and MagnaTagATune for music.

Compared with traditional codecs, SoundStream's strength is quality at very low bitrates and its ability to treat any kind of sound with one model. Its costs are the usual neural ones: it must be trained on large audio collections, and both ends must run the network rather than a compact hand-written algorithm. Compared with Google's first Lyra codec, an autoregressive generative model at 3 kbps, SoundStream is not autoregressive and was designed for low latency. Later codecs built on the same recipe include Meta's EnCodec, released in October 2022 for 24 kHz mono and 48 kHz stereo audio, and the Improved RVQGAN codec, which reports roughly 90 times compression of 44.1 kHz audio into 8 kbps.

The codec's limits are documented in its own paper and its successors. Quality falls as fewer quantizers are used, and latency is a trade-off: doubling the frame length to 26.6 ms requires 160 bits per frame for the same 6 kbps budget. Bitstreams are tied to a specific trained model, so both ends must run the same weights, unlike standardized codecs with fixed formats. The authors also note in the paper that PESQ and POLQA, the usual ITU-T quality metrics, are inconvenient to use because of licensing restrictions, so they relied on the open ViSQOL metric and human tests for evaluation.

SoundStream's second life is as an audio tokenizer. Because RVQ turns audio into a grid of discrete integers, those integers can be modeled like words. Google's AudioLM, announced in October 2022, uses SoundStream codes as acoustic tokens, generating them with language models and decoding them with the SoundStream decoder. In practice, developers who want SoundStream for calls can use Lyra V2, released under the Apache license in September 2022 for Android and Linux with experimental Mac and Windows support.

04Δουλευμένο παράδειγμα

Working out SoundStream's bitrate from its settings

  1. Start with the sample rate, 24,000 samples per second, and the encoder's total stride, 2 x 4 x 5 x 8 = 320.

  2. Divide to get frames per second: 24,000 / 320 = 75 embeddings each second, one every 13.3 ms.

  3. Pick a codebook size of 1,024 entries, which needs log2(1,024) = 10 bits per quantizer index.

  4. Choose 4 quantizer layers: 75 x 4 x 10 = 3,000 bits per second, or 3 kbps.

  5. Choose 8 layers instead: 75 x 8 x 10 = 6,000 bits per second, or 6 kbps.

  6. Choose 24 layers: 75 x 24 x 10 = 18,000 bits per second, the top of SoundStream's 3 to 18 kbps range.

Αυτό που δείχνει

The learner can now predict the bitrate of any RVQ codec from three numbers: frame rate, number of quantizers and bits per codebook. A check: Lyra V2's 3.2, 6 and 9.2 kbps modes are chosen the same way, by changing the number of quantizers used.

Υλοποίηση σε πραγματικό κόσμο

Google's Lyra V2 speech codec, released as open source in September 2022, is built on SoundStream and offers 3.2, 6 and 9.2 kbps modes, with 20 ms latency and encoding plus decoding of a 20 ms frame in 0.57 ms on a Pixel 6 Pro.

Google's AudioLM, announced in October 2022, uses SoundStream codes as its acoustic tokens, generating speech and piano continuations as token sequences and then decoding them back to waveforms with the SoundStream decoder.

Low-bandwidth voice calls are the original target: the SoundStream paper reports that at 3 kbps it outperformed Opus at 12 kbps and approached EVS at 9.6 kbps in crowd-sourced listening tests on 24 kHz audio.

One SoundStream variant performs compression and background noise removal in the same model, switched on or off by a conditioning signal, so a call app could clean up speech without adding latency.

Meta's EnCodec (2022) and the Improved RVQGAN codec (NeurIPS 2023) follow the same encoder, residual quantizer and adversarial decoder recipe, the latter compressing 44.1 kHz audio about 90 times to 8 kbps.

The Future of SoundStream Neural Audio Codec

SoundStream's design has become a template. Meta's EnCodec (October 2022) and the Improved RVQGAN codec (NeurIPS 2023 spotlight) both pair a convolutional encoder and decoder with residual vector quantization and adversarial training, extending the idea to 48 kHz stereo and to roughly 90 times compression of 44.1 kHz audio. Lyra V2 (September 2022) showed that the approach can ship as an open-source, real-time product with 20 ms latency. The larger shift is that neural codecs now serve generative AI as much as communication. AudioLM (2022) treated SoundStream codes as a vocabulary for language models, and later speech and music generators adopted similar codec tokens. That raises open questions about how many tokens per second a generator should model, how to separate content from speaker identity, and how to keep codes useful for both compression and generation. Open problems for real-world use include robustness to unusual audio, fairness across languages and voices, interoperability, since each trained model defines its own bitstream, and evaluation, since the SoundStream authors relied on human tests and the open ViSQOL metric rather than licensed ITU-T scores. Detecting synthetic audio produced through codec-based generators is also an active area, as Google's AudioLM work noted with its own detection classifier.

Κάνοντάς το στην πράξη

Γιατί έχει σημασία

  • Πρόσβαση και προσέγγιση χρηστών. Βελτιώνει την προσβασιμότητα μέσω διασυνδέσεων μεταγραφής, αφήγησης και φωνής.
  • Κόστος και προϋπολογισμός. Οι ομάδες πολυμέσων μπορούν να αποστέλλουν γυαλισμένο ήχο πιο γρήγορα με μικρότερους προϋπολογισμούς.
  • Ταχύτητα και κλίμακα. Τα συστήματα που αντιμετωπίζουν πελάτες μπορούν να επεξεργάζονται προφορικές αλληλεπιδράσεις σε μεγαλύτερη κλίμακα.

Προσέξτε

  • Οι κίνδυνοι κατάχρησης φωνής και πλαστοπροσωπίας αυξάνονται όταν λείπει η συγκατάθεση.
  • Η ακρίβεια μπορεί να πέσει σε τόνους, διαλέκτους ή θορυβώδη περιβάλλοντα.
  • Ο συνθετικός ήχος μπορεί να εκληφθεί εσφαλμένα ως αυθεντική ομιλία χωρίς σαφή σήμανση.

Επόμενα βήματα

  1. Λάβετε ρητή συγκατάθεση για λήψη φωνής, κλωνοποίηση και επαναχρησιμοποίηση.
  2. Δοκιμάστε την ποιότητα σε διαφορετικά ηχεία και συνθήκες φόντου.
  3. Καθορίστε πότε ένας άνθρωπος πρέπει να επανεξετάσει ή να εγκρίνει τα αποτελέσματα.
  4. Επισημάνετε τον συνθετικό ήχο και κρατήστε αρχεία προέλευσης για υπευθυνότητα.

Πηγές και περαιτέρω ανάγνωση

  1. arXivSoundStream: An End-to-End Neural Audio Codec
  2. Google Research BlogSoundStream: An End-to-End Neural Audio Codec
  3. Google Open Source BlogLyra V2: a better, faster, and more versatile speech codec
  4. Google Research BlogAudioLM: a Language Modeling Approach to Audio Generation
  5. arXivHigh Fidelity Neural Audio Compression
  6. arXiv (NeurIPS 2023)High-Fidelity Audio Compression with Improved RVQGAN

Συνεχίστε την εξερεύνηση

Δωρεάν ενημερωτικό δελτίο

Λάβετε την καθημερινή ενημέρωση AI

Τρία επαληθευμένα νέα AI κάθε πρωί της εβδομάδας, γραμμένα σε απλή αγγλική. Δωρεάν για πάντα, χωρίς διαφημίσεις.

Ένα email κάθε εργάσιμη ημέρα. Κατάργηση συνδρομής με ένα κλικ. Δεν πουλάμε ή μοιραζόμαστε ποτέ τη διεύθυνσή σας.

Δοκιμάστε τον εαυτό σας

Take the SoundStream Neural Audio Codec quiz

Άμεση ανάδραση σε κάθε απάντηση, και πιστοποιητικό με επαληθεύσιμο ID μόλις περάσετε το μάθημα.

Έναρξη κουίζ

Υποστηρίξτε τη δωρεάν εκπαίδευση AI. AI Understanding είναι μια μη κερδοσκοπική οργάνωση 501(c)(3) — χωρίς διαφημίσεις, χωρίς τοίχο πληρωμής, ποτέ. Κάντε μια δωρεά

Συχνές ερωτήσεις

What is SoundStream Neural Audio Codec?

SoundStream is a neural audio codec from Google Research, published in July 2021, that compresses speech, music and general audio with a learned encoder, a residual vector quantizer and a learned decoder. In listening tests it matched or beat traditional codecs at a fraction of their bitrate, and its discrete codes became a standard way to turn audio into tokens for generative models.

Ποια τρία στοιχεία συνθέτουν την αρχιτεκτονική SoundStream;

Το SoundStream είναι κατασκευασμένο από έναν συνελικτικό κωδικοποιητή, έναν υπολειπόμενο διανυσματικό κβαντιστή που διακρίνει τις ενσωματώσεις και έναν συνελικτικό αποκωδικοποιητή, όλα εκπαιδευμένα από άκρο σε άκρο.

Ποια τεχνική επιτρέπει σε ένα μοντέλο SoundStream να εξυπηρετεί πολλούς διαφορετικούς ρυθμούς μετάδοσης δεδομένων χωρίς επανεκπαίδευση;

Κατά τη διάρκεια της προπόνησης, το SoundStream ρίχνει τυχαία επίπεδα κβαντιστή, έτσι ώστε να μπορείτε να χρησιμοποιήσετε περισσότερα ή λιγότερα επίπεδα RVQ για να πετύχετε διαφορετικούς ρυθμούς bit από ένα μοντέλο.

Στις δοκιμές ακρόασης του Google, αναφέρθηκε ότι το SoundStream στα 3 kbps υπερέχει από ποιον κωδικοποιητή στα 12 kbps;

Το SoundStream με μόλις 3 kbps ταιριάζει ή ξεπερνά τον ευρέως χρησιμοποιούμενο κωδικοποιητή Opus που τρέχει στα 12 kbps σε υποκειμενικές αξιολογήσεις ποιότητας.

Τι είδους πρόσθετο σήμα εκπαίδευσης χρησιμοποιεί το SoundStream για να κάνει την έξοδο φυσικό ήχο;

Πέρα από τις απώλειες ανακατασκευής, το SoundStream χρησιμοποιεί αντιπάλους (GAN) διαχωριστές, έτσι οι ανακατασκευές ακούγονται αντιληπτικά ρεαλιστικές και όχι απλώς αριθμητικά κοντινές.

Πώς σχετίζεται το bitrate του SoundStream με τους κβαντιστές του;

Ο ρυθμός μετάδοσης δεδομένων κλιμακώνεται με τον αριθμό των ενεργών επιπέδων RVQ (χρόνος του ρυθμού καρέ επί bits ανά βιβλίο κωδικών), επομένως η προσθήκη κβαντιζόντων αυξάνει τον ρυθμό μετάδοσης bit και την ποιότητα.

Συνέχισε να μαθαίνεις

Σχετικοί οδηγοί

Επιλέχθηκαν περισσότεροι οδηγοί για αυτό το θέμα

Λάβετε ένα δωρεάν πιστοποιητικό AIΈνα σύντομο δωρεάν μάθημα και εξέταση. Χωρίς κόστος, χωρίς κάρτα. Περίπου 2,5 ώρες.Ξεκινήστε δωρεάν →