This is a CoreML decoder based on BigVGAN, converting latent tensors into raw audio waveforms at 48 kHz.
It is intended to be used as the final decoding stage in a latent-audio pipeline, leveraging the CoreML stuff with a significant speed up and stability against ONNX or PyTorch in MPS.
Type: float32 or float16 (both accepted, identical output)
64 → latent channel dimension
T → temporal latent length
Base time unit (important)
The CoreML model is exported with a fixed base window of T = 50.
Original bigvgan.decode_audio() does the work internally, so there's no T restriction. The same behavior can be reproduced with ONNX but not in CoreML.
PyTorch Internals (from decoder.json):
fps = 5
T = 50 ≈ 10 seconds of audio
1 latent frame ≈ 0.2 seconds
In CoreML, this model expects exactly T = 50 per call.
Output
Tensor shape: [1, 1, 480000]
Sampling rate: 48,000 Hz (fixed by the model)
Duration: ~10 seconds per decode call
The output length is fixed and non-configurable.
Precision behavior
Model is exported as FP32 with macOS14 minimum deployment target.
Inputs may be float16 or float32.
No casting is required.
Decoding longer audio (required)
For latents with T > 50, decoding must be done manually by chunking.
Recommended:
Chunk size: T = 50 → For this model, always 50, but the script keeps dynamic if the model is converted to other T.
Overlap: 5 frames (though with 10~30 haven't heard any substantial difference. Open a discussion if you found a better way to achieve it.)
Reconstruction: windowed overlap-add
Padding is required for the final chunk if T is not divisible by 50.
Extra decoded audio introduced by padding must be trimmed.
Naive overlap causes noticeable gain increase.
Zero overlap avoids gain increase but may introduce small boundary artifacts.