EnCodec round trip
EnCodec compresses audio into a few streams of tokens and decodes them back. Running a
codec.reconstruct operation on a sound shows you both ends and the tokens in between: the input
as the model hears it, the token streams (one per codebook), the reconstruction, and how far it
differs from the input. Here the input is a four-second, eight-voice chord rendered by Field's
Faust example.
To run the examples on this page, open the audio_ai_codec starting point.

Listen to the model input and its EnCodec reconstruction.
Both players hold the 32 kHz mono audio the model actually reads and writes, so the waveforms and spectra line up sample for sample. The operation also returns a 48 kHz copy for listening. The waveform players are the ordinary audio visualizer: click to seek, drag to pan, and use the wheel to zoom.
To analyse your own sound, submit codecReconstruction(region), wait for it with
client.awaitCodec(accepted), then display client.codecVisualizationHtml(result, cacheDirectory).