ΟΔΗΓΟΣ Audio AI

Νευρωνικοί κωδικοποιητές ήχου

Ένας νευρωνικός κωδικοποιητής ήχου είναι ένα ζεύγος νευρωνικών δικτύων που συμπιέζει τον ήχο σε ένα μικρό ρεύμα αριθμών και αναδομεί την κυματομορφή από αυτό.

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

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

Επισκόπηση

Systems such as Google's SoundStream (2021), Meta's EnCodec (2022) and Descript's DAC (2023) beat traditional codecs at low bitrates, and their discrete tokens are now the vocabulary that speech and music generators such as VALL-E, MusicGen and Moshi predict.

Βασικά takeaways

  1. A neural audio codec uses a trained encoder, a quantizer and a decoder to compress audio into integer codes and rebuild the waveform.
  2. Residual vector quantization stacks quantizers that each encode what the previous ones missed, so dropping later codebooks lowers bitrate gracefully.
  3. In Google's listening tests, SoundStream at 3 kbps outperformed the Opus codec at 12 kbps on 24 kHz audio.
  4. Descript's DAC compresses 44.1 kHz audio about 90 times, to 8 kbps, with one model for speech, music and other sounds.
  5. Codec tokens are the vocabulary of audio language models such as VALL-E, MusicGen and Kyutai's Moshi.

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

A codec, short for coder-decoder, turns audio into a compact bitstream and back. Traditional codecs such as MP3, Opus and EVS are designed by engineers using signal processing: a transform splits the sound into frequency components, a perceptual model decides which components the ear will not miss, and the rest are quantized, meaning rounded to a limited set of values, then entropy coded. A neural audio codec replaces most of that hand-designed pipeline with networks trained on large amounts of audio. An encoder network turns the waveform into a short sequence of vectors, a quantizer turns each vector into a few integers, and a decoder network rebuilds a waveform from those integers. Because the whole chain is trained end to end, the system learns what to keep and what to discard.

Google's SoundStream, posted in July 2021 by Neil Zeghidour and colleagues, set the template. Its encoder is a stack of convolutions that downsamples by strides of 2, 4, 5 and 8, so one embedding is produced for every 2 x 4 x 5 x 8 = 320 samples. At 24,000 samples per second, that is 75 frames per second. To hit 6 kbps, each frame gets 80 bits. A plain vector quantizer would need a codebook, a lookup table of learned vectors, with 2 to the 80th power entries, which the paper calls obviously unfeasible. SoundStream instead uses residual vector quantization (RVQ): the first quantizer picks the nearest of 1,024 codebook vectors, the second quantizes what the first missed, and so on. Eight quantizers with 1,024 entries each, 10 bits apiece, give the 80 bits.

RVQ also makes bitrate adjustable. SoundStream trained with quantizer dropout, randomly using only the first few quantizers in each training example, so a single model works at 3 to 18 kbps by sending more or fewer codebook indices. Training combines reconstruction losses, which compare the output with the original, and adversarial losses from discriminator networks that try to tell decoded audio from real audio, a technique borrowed from neural speech synthesis. Both encoder and decoder use only causal convolutions, which look only at past samples, so the codec can stream with latency set by the 320-sample frame. In the paper's listening tests, SoundStream at 3 kbps outperformed Opus at 12 kbps and approached EVS at 9.6 kbps.

Meta's EnCodec, posted in October 2022 by Alexandre Defossez, Jade Copet, Gabriel Synnaeve and Yossi Adi, kept the encoder, RVQ and decoder design but simplified training with a single multiscale spectrogram discriminator and added a loss balancer, which sets each loss weight as a fraction of the total gradient. It also used a small transformer language model with entropy coding to shrink the bitstream by up to 40% while staying faster than real time. Its models use up to 32 codebooks of 1,024 entries, 75 frames per second at 24 kHz, and in MUSHRA listening tests, a standard method in which listeners score clips against a hidden reference, it beat Opus, EVS and Google's Lyra-v2 across speech, noisy speech and music.

Descript's Descript Audio Codec (DAC), from the June 2023 paper on Improved RVQGAN by Rithesh Kumar, Prem Seetharaman and colleagues, pushed quality further. It compresses 44.1 kHz audio about 90 times, to 8 kbps, with one model for speech, music and environmental sound. The authors identified codebook collapse, in which many codebook entries go unused and bandwidth is wasted, and fixed it with two techniques from image models: projecting vectors to a low-dimensional space before lookup and normalizing them. They also found that standard quantizer dropout hurt full-bitrate quality and applied it to only some training examples. In their listening tests DAC scored much higher than EnCodec at all bitrates tested, though still below the original audio.

The second role of these codecs turned out to be as important as compression. Their integer codes are discrete tokens, the same kind of input language models are built to predict. VALL-E trained a language model on codec tokens to clone a voice from 3 seconds of audio, MusicGen interleaves several codebook streams so one transformer can generate music, and Kyutai's Mimi codec, described in the September 2024 Moshi paper, distills semantic information from the WavLM speech model into its first quantizer so that a single token stream carries both meaning and sound at 12.5 frames per second.

Compared with traditional codecs, neural codecs win most clearly at low bitrates, where engineered codecs introduce audible artifacts. At higher bitrates, established codecs remain efficient, standardized and supported by every device. Neural codecs cost more computation, need a matching decoder on both ends, and can fail in unfamiliar ways: rather than adding hiss, a generative decoder can produce plausible but wrong detail, such as smeared consonants or altered timbre, especially on sounds unlike its training data. Because codec tokens let a language model continue a voice from a 3-second sample, as VALL-E showed, the same technology that compresses speech also makes convincing voice imitation easier.

In practice, using a neural codec is simple: EnCodec and DAC publish code and pretrained weights, and encoding or decoding runs on a laptop. EnCodec's paper targeted models that run in real time on a single CPU core. Training a new codec is a larger job, because it needs large and varied audio collections and adversarial training with several discriminator networks.

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

Working out a codec's bitrate from its design

  1. Take a codec that receives 24 kHz audio and downsamples with strides 2, 4, 5 and 8.

  2. Multiply the strides: 2 x 4 x 5 x 8 = 320 samples per frame, so 24,000 / 320 = 75 frames per second.

  3. Choose 8 residual quantizers, each with a codebook of 1,024 entries, which is 10 bits per index.

  4. Bits per frame: 8 x 10 = 80; bitrate: 75 x 80 = 6,000 bits per second, or 6 kbps.

  5. Drop to the first 4 quantizers: 75 x 4 x 10 = 3,000 bits per second.

  6. Compare a single quantizer with 80 bits: its codebook would need 2 to the 80th power entries.

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

The learner reproduces SoundStream's 6 kbps configuration and sees how residual quantization trades bitrate for quality by sending more or fewer codebook indices, while avoiding an impossibly large single codebook.

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

Low-bitrate calls: in listening tests on 24 kHz audio, SoundStream at 3 kbps was rated above the Opus codec at 12 kbps, and a single model covered bitrates from 3 to 18 kbps while running in real time on a smartphone CPU.

Music and stereo compression: Meta's EnCodec supports 1.5, 3, 6, 12 and 24 kbps for 24 kHz mono audio and 3 to 24 kbps for 48 kHz stereo, with code and models released on GitHub.

Text-to-speech: Microsoft's VALL-E (January 2023) trained a language model on the discrete codes of an off-the-shelf neural codec using 60,000 hours of English speech, and cloned a voice from a 3-second sample.

Music generation: Meta's MusicGen (NeurIPS 2023) is a single transformer that predicts several parallel streams of compressed music tokens, generating mono or stereo music from text or a melody.

Spoken dialogue: Kyutai's Moshi uses its Mimi codec, 8 quantizers at 12.5 frames per second for 1.1 kbps, to model the user's and its own speech as parallel token streams, with a reported 200 ms practical latency.

Το μέλλον των νευρωνικών κωδικοποιητών ήχου

Research on neural codecs is now driven as much by generative modeling as by compression. Lower frame rates mean shorter token sequences for a language model, which is why Kyutai's Mimi runs at 12.5 frames per second, compared with 75 for SoundStream and EnCodec. Distilling semantic information into the first codebook, as Mimi does with WavLM features, aims to give a single token stream that captures both what is said and how it sounds, whereas earlier audio language models such as AudioLM combined codec tokens with separate semantic tokens from a self-supervised speech model. Open problems include closing the remaining quality gap at full bandwidth, which the DAC authors noted still exists even at their highest bitrate, handling music, overlapping speakers and noisy recordings as well as clean speech, and keeping decoders cheap enough for phones and real-time calls. Standardization is another gap: traditional codecs are interoperable because their bitstreams are specified, while each neural codec currently needs its own decoder weights, so a stream encoded with one model cannot be decoded by another. The ability of codec-based language models to imitate a voice from a few seconds of audio has also raised questions about consent, watermarking and detection of synthetic speech. How well detectors and watermarks survive re-encoding by a different codec is an active research topic with no settled answer.

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

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

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

Προσέξτε

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

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

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

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

  1. arXivSoundStream: An End-to-End Neural Audio Codec
  2. arXivHigh Fidelity Neural Audio Compression
  3. arXivHigh-Fidelity Audio Compression with Improved RVQGAN
  4. arXivMoshi: a speech-text foundation model for real-time dialogue
  5. arXivNeural Codec Language Models are Zero-Shot Text to Speech Synthesizers
  6. arXiv (NeurIPS 2023)Simple and Controllable Music Generation

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

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

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

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

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

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

Take the Neural Audio Codecs quiz

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

Έναρξη κουίζ

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

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

What is Neural Audio Codecs?

A neural audio codec is a pair of neural networks that compresses sound into a small stream of numbers and rebuilds the waveform from it. Systems such as Google's SoundStream (2021), Meta's EnCodec (2022) and Descript's DAC (2023) beat traditional codecs at low bitrates, and their discrete tokens are now the vocabulary that speech and music generators such as VALL-E, MusicGen and Moshi predict.

Ποια δύο πράγματα κάνει πρωτίστως ένας νευρωνικός κωδικοποιητής ήχου;

Ένας νευρωνικός κωδικοποιητής είναι ένα δίκτυο κωδικοποιητή-αποκωδικοποιητή που συμπιέζει μια κυματομορφή σε συμπαγή διακριτά διακριτικά και στη συνέχεια αναδομεί τον ήχο από αυτά.

Ποια τεχνική κβαντοποίησης είναι κεντρική σε κωδικοποιητές όπως το SoundStream και το EnCodec;

Το RVQ στοιβάζει πολλά βιβλία κωδίκων όπου το καθένα κωδικοποιεί το υπολειπόμενο σφάλμα του προηγούμενου, επιτρέποντας μια αντιστάθμιση ποιότητας έναντι ρυθμού bit.

Στο Residual Vector Quantization, τι κωδικοποιεί κάθε διαδοχικό βιβλίο κωδικών;

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

Γιατί οι νευρωνικοί κωδικοποιητές ήχου είναι σημαντικοί για τα μοντέλα παραγωγής ήχου;

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

Πώς η χρήση περισσότερων βιβλίων κωδικών σε έναν νευρωνικό κωδικοποιητή επηρεάζει την έξοδο;

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

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

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

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

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