Audio-to-Audio
English
music
code
Metacebertrunk commited on
Commit
060085e
Β·
verified Β·
1 Parent(s): b74393d

Upload Hcodec readme

Browse files

![HCodec](https://cdn-uploads.huggingface.co/production/uploads/677f3d364005f2fe7ee5b5a5/HqZnwtXDjvoSAJMEMzNFm.jpeg)

Files changed (1) hide show
  1. README.md +84 -0
README.md CHANGED
@@ -7,3 +7,87 @@ tags:
7
  - music
8
  - code
9
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  - music
8
  - code
9
  ---
10
+ # QuarkAudio-HCodec: A Unified Discrete Audio Tokenizer for High-Fidelity, Multitask Audio Generation
11
+
12
+ <p align="center">
13
+ <a href="https://arxiv.org/abs/2510.26372">
14
+ <img src="https://img.shields.io/badge/Paper-ArXiv-red.svg" alt="Paper">
15
+ </a>
16
+ <a href="https://huggingface.co/spaces/QuarkAudio/">
17
+ <img src="https://img.shields.io/badge/Model-Hugging%20Face-yellow.svg" alt="Hugging Face">
18
+ </a>
19
+ </p>
20
+
21
+ <p align="center">
22
+ <a href="https://arxiv.org/abs/2510.26372"><img src="HCodec.jpg" width="70%" /></a>
23
+ </p>
24
+
25
+ > πŸ”Š **H-Codec**: *A Unified, Dual-Stream Neural Audio Codec with Adaptive Frame Rate and 48kHz Support*
26
+ > Enabling high-fidelity, efficient, and semantically rich audio tokenization for next-generation LLM-based audio generation.
27
+
28
+ πŸš€ **Key Highlights**:
29
+ - βœ… **Dual-Stream Tokenization**: Separately quantizes acoustic and semantic features into independent codebooks β€” preserving both signal fidelity and linguistic content.
30
+ - πŸ”„ **Dynamic Frame Rate (H-Codec-1.5)**: Introduces an adaptive temporal resolution mechanism built upon H-Codec-1.0, enabling variable frame rates based on content complexity.
31
+ - βš™οΈ **Multi-Sampling Rate (H-Codec-2.0)**: Extends the sampling rate from **16kHz to 48kHz** under a fixed frame rate, significantly improving audio fidelity and high-frequency detail preservation.
32
+ - 🌍 **Unified Foundation**: Designed as a core component for multimodal LLMs, supporting diverse downstream tasks: TTS, VC, Editing, TTA, SE, and more.
33
+
34
+ πŸ“„ **Paper**: [arXiv:2510.26372](https://arxiv.org/abs/2510.26372) | 🎀 **Listen**: [Demo Page](https://hyyan2k.github.io/UniSE/) | πŸ€— **Model**: [Hugging Face Spaces](https://huggingface.co/spaces/QuarkAudio/)
35
+
36
+ ---
37
+
38
+ ## πŸ“¦ Overview
39
+
40
+ This project introduces **H-Codec**, a unified discrete audio tokenizer that integrates self-supervised learning (SSL) representations into the codec architecture to enable **dual-stream (acoustic + semantic) tokenization**. Unlike prior work that fuses modalities before quantization (e.g., X-Codec), H-Codec employs **separate codebooks** for acoustic and semantic streams, allowing independent optimization and better reconstruction quality.
41
+
42
+ We extend the original H-Codec (*aka* H-Codec-1.0) in *UniTok-Audio (Liu et al., 2025)* into two advanced variants:
43
+
44
+ | Version | Key Feature | Sampling Rate | Frame Rate |
45
+ |---------------|----------------------------------|---------------|----------------|
46
+ | **H-Codec-1.0** | Dual-stream quantization | 16 kHz | Fixed |
47
+ | **H-Codec-1.5** | Dynamic frame rate adaptation | 16 kHz | Adaptive |
48
+ | **H-Codec-2.0** | Full-bandwidth 48kHz support | 48 kHz | Fixed |
49
+
50
+ These improvements significantly enhance **audio fidelity**, **temporal efficiency**, and **applicability** across speech, music, and general audio.
51
+
52
+ πŸ”§ **Architecture Core Components**:
53
+ 1. **Encoder**: Extracts continuous representations from waveform and SSL model (e.g., WavLM).
54
+ 2. **Quantizer Module**: Two independent codebooks β€” one for acoustic details, one for semantic meaning.
55
+ 3. **Decoder**: Reconstructs high-quality audio from discrete token sequences.
56
+
57
+ πŸ’‘ H-Codec is designed as a foundational module for **LLM-based audio generation**, seamlessly integrating with autoregressive language models for end-to-end training and inference.
58
+
59
+ <!-- ---
60
+
61
+ ## 🧰 Installation
62
+
63
+ ### Option 1: Using pip
64
+
65
+ ```bash
66
+ pip install -r requirements.txt -->
67
+
68
+
69
+ ---
70
+
71
+ ## 🎯 Quick Start: Run Inference in 3 Minutes
72
+
73
+ ### 1. Clone Repository
74
+
75
+ ```bash
76
+ git clone https://github.com/alibaba/unified-audio.git
77
+ cd QuarkAudio-HCodec
78
+ ```
79
+
80
+ ### 2. Create a Conda environment and install dependencies
81
+
82
+ ```bash
83
+ conda create -n unise python=3.10
84
+ conda activate unise
85
+ pip install -r requirements.txt
86
+ ```
87
+
88
+ ## 3. Tokenizer
89
+
90
+ ```bash
91
+ #!/bin/bash
92
+ python audio_tokenizer.py
93
+ ```