LiteRT

E2A2 spatial_audio codec for compressionkit

E2A2 (Encoding Efficient Asymmetric Autoencoders) spatial_audio is an audio codec for the seven-microphone array of Project Aria glasses at 48 kHz, the seven channels coded together. This repository holds its weights in the layout that compressionkit v0.3 reads, with an encoder half and a decoder half that load separately.

Source and permission

The weights are redistributed from their original public release, danjacobellis/E2A2, subfolder spatial_audio/, revision aafe5975, with the permission of the author, Dan Jacobellis. Ambiq did not train this codec. Its description, development and evaluation are documented at the original source and on the codec's page, https://danjacobellis.net/compressors/E2A2_spatial_audio. The entropy coder is GGDLPC (https://danjacobellis.net/GGDLPC/).

Every tensor here equals the tensor of the same name at that revision; this repository divides them into the encoder and decoder halves listed below and adds the files compressionkit uses.

Files

  • encoder/config.json, encoder/weights.safetensors (the merged.{op}.encoders.* tensors) and encoder/entropy.json (the GGDLPC tables): everything needed to encode.
  • decoder/config.json, decoder/weights.safetensors (the merged.{op}.decoder.* tensors): everything needed to decode. Each config.json is the full source configuration, so each half constructs alone.
  • rd.json: the rate–distortion curve of the original release, byte-identical to it. The validation clips were coded as stored (no normalization), so the input scaling is fixed. Rates are bits per frame, the seven channels summed.
  • web/: the decoder of each operating point that the compressionkit browser demo offers, as LiteRT files (section below). The compressionkit loaders do not download web/.
file bytes SHA-256
decoder/config.json 1,536 6681cc25f7b190e8cccc9e489aa58020f59ca6c5d7813fe489089078ef1858d5
decoder/weights.safetensors 2,450,820,696 28d762dfc52da141c488735effddff82d61984ebb19a1c61a84a9dc0cb3144b4
encoder/config.json 1,536 6681cc25f7b190e8cccc9e489aa58020f59ca6c5d7813fe489089078ef1858d5
encoder/entropy.json 17,826 092f7746670780573eb349c5418dafbf72c2dfe2ed85678c527a5e0aacfa5607
encoder/weights.safetensors 513,704 65e860cf924da8fc4cae4f2ee48b7f82af1928a493ac7e0fb50e440a472c1296
rd.json 578 9796ac3c08304da1698571a86444b19a98d10b5b1ac9b4cffa4e9d78893b9ee1

Input, output and operating points

Input: float32 (7, L) samples at 48 kHz in the scale of the recordings it was developed on (no input map is published). Output: a reconstruction in the same form. Operating points (cumulative latent channels): [16, 32, 56, 80]. The stream of a lower operating point is a literal bit-prefix of the stream of the highest, and the rates are entropy-coded bits. compressionkit converts nothing: each codec states its input type and range.

Using it with compressionkit

compressionkit v0.3 is in pre-release; these loaders are part of it.

from compressionkit.e2a2 import hub

# both halves
config, weights, coder, ops = hub.load_split_from_hub('spatial_audio')
model = hub.load_codec(config=config, weights=weights, n_ch=ops[-1])

# one half (encode-only shown; half='decoder' for decode-only)
cfg, w, coder, ops = hub.load_split_from_hub('spatial_audio', half='encoder')
encoder = hub.build_partial(cfg, w, ops[-1])

Status and limitations

  • A reference codec for evaluation and development with compressionkit, redistributed as released; not a production model, and not qualified for any product or regulated use.
  • Its quality on data unlike the data of its original release is not characterized here; measure it on your own data (compressionkit.calibrate fits an input map on your training split).
  • Maintainer for compressionkit: Dan Jacobellis (Ambiq). Questions about the codec itself: the original source.

Browser decoders (web/)

For each operating point the compressionkit browser demo offers, its decoder as a LiteRT .tflite window decoder, which runs in a web browser on LiteRT.js (CPU), with a .json beside it that gives its shapes and windowing. A window decodes chunk output samples (pixels along each side for the image codec) with margin of context on each side; the latent grid is cut into overlapping windows and the outputs joined. The PSNR column is the largest difference between the PSNR of the joined output, decoded in LiteRT.js in Chromium, and that of the full-size PyTorch decode, over the example recordings of the demo. The compressionkit loaders do not download web/.

file operating point chunk margin bytes PSNR difference (dB, rows) decoder weights (SHA-256)
web/spatial_audio_op16_chunk16384_m4096.tflite 16 16384 samples 4096 410,460,028 3.3e-09 (1) 28d762dfc52d
web/spatial_audio_op32_chunk16384_m4096.tflite 32 16384 samples 4096 410,656,636 3.9e-10 (1) 28d762dfc52d
web/spatial_audio_op56_chunk16384_m4096.tflite 56 16384 samples 4096 814,609,900 8.0e-09 (1) 28d762dfc52d
web/spatial_audio_op80_chunk16384_m4096.tflite 80 16384 samples 4096 815,789,548 3.4e-07 (1) 28d762dfc52d

Weights fp32, converted from decoder/weights.safetensors with litert-torch 0.10.0. The last column gives the start of the SHA-256 of the decoder/weights.safetensors it was converted from, which is this repository's.

Downloads last month
20
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support