Skip to content

PABannier/encodec.cpp

Repository files navigation

encodec.cpp

encodec.cpp

Actions Status License: MIT

High-performance inference of Meta's Encodec deep learning based audio codec model:

  • Plain C/C++ implementation without dependencies using ggml

The entire implementation of the model is contained in 3 source files:

Tensor operations: ggml.h / ggml.c
Inference: encodec.h / encodec.cpp

Roadmap

  • Support of 24Khz model
  • Support of 48Khz model
  • Encodec's language model support
  • Mixed F16 / F32 precision

Implementation details

  • The core tensor operations are implemented in C (ggml.h / ggml.c)
  • The encoder-decoder architecture and the high-level C-style API are implemented in C++ (encodec.h / encodec.cpp)
  • Basic usage is demonstrated in main.cpp

Usage

Here are the steps for the bark model.

Get the code

git clone --recurse-submodules https://github.com/PABannier/encodec.cpp.git
cd encodec.cpp

Build

In order to build encodec.cpp you must use CMake:

mkdir build
cd build
cmake ..
cmake --build . --config Release