Unlocking Temporal Flexibility: Neural Speech Codec with Variable Frame Rate

Hanglei Zhang, Yiwei Guo, Zhihan Li, Xiang Hao, Xie Chen, Kai Yu

Introduction

Modern neural speech codecs, such as EnCodec and Descript Audio Codec (DAC), have revolutionized audio compression by leveraging deep learning to achieve high-fidelity reconstruction at low bitrates. However, these models typically operate at a Constant Frame Rate (CFR), producing a fixed number of tokens per second regardless of the audio's content. This approach introduces significant temporal redundancy, as silent intervals or steady-state vowels are assigned the same resolution as complex phonetic transitions. Furthermore, the resulting long token sequences impose a heavy computational burden on downstream generative models, such as VALL-E or AudioLM, which must predict these tokens autoregressively.

To address these inefficiencies, researchers have introduced Temporally Flexible Coding (TFC), the first technique to bring Variable Frame Rate (VFR) capabilities to neural speech codecs. TFC dynamically adjusts the frame rate based on the "information density" of the speech signal, optimizing bit allocation and reducing sequence length without compromising quality.

The Challenge of Constant Frame Rate

The reliance on CFR in current codecs stems from architectural simplicity but leads to two primary drawbacks:

  1. Redundancy: Bits are wasted on regions of the signal that do not require high-resolution tracking, such as silence or prolonged vowels.
  2. Downstream Latency: Generative models often operate at a much slower rate (e.g., 3–5 text tokens per second) compared to speech codecs (50–75 Hz). This discrepancy creates a bottleneck, increasing latency and computational overhead in real-time applications.

While Variable Bitrate (VBR) techniques have been explored, they typically maintain a constant number of frames per second. TFC tackles the problem of "temporal redundancy" by allowing the number of frames themselves to vary according to the complexity of the audio.

Methodology: Temporally Flexible Coding

TFC is designed as a "plug-and-play" module that can be integrated into existing codec backbones. In current evaluations, it has been implemented on top of the Descript Audio Codec (DAC).

Measuring Information Density

The core of TFC is a non-parametric approach to determine local information density using Temporal Entropy. The system calculates Gaussian affinity for speech amplitudes across uniformly spaced bins and applies Shannon Entropy to identify "complex" segments. High entropy values signal information-rich transitions requiring high resolution, while low entropy indicates simpler regions like silence.

Figure 1: (a) The TFC architecture showing the multi-resolution encoder and conditional hierarchical decoder. (b) Visualization of dynamic masking across different granularity ratios.

Multi-Resolution Representations and Dynamic Masking

As shown in Figure 1(a), the encoder generates three levels of resolution:

  • Fine (75 Hz): The original backbone rate.
  • Medium (37.5 Hz): Downsampled by a factor of 2.
  • Coarse (18.75 Hz): Downsampled by a factor of 4.

Based on the calculated entropy values and user-specified "granularity ratios" ($r_f, r_m, r_c$), the system generates binary masks. These masks dictate which segments of the audio are represented at which resolution. Figure 1(b) illustrates how these masks adapt to the waveform: coarse frames are allocated to silence or low-activity segments, while fine frames are reserved for complex speech.

Conditional Hierarchical Decoder

To reconstruct the audio, TFC employs a conditional hierarchical decoder. The process begins with the coarse representation and progressively "fuses" in medium and fine details only where the masks indicate their presence. This hierarchical approach prevents error propagation and ensures that high-resolution details are only added where they are most needed.

Experimental Setup and Results

The models were trained and evaluated on the LibriTTS dataset, a 960-hour corpus of English speech. Performance was measured using signal fidelity metrics (Mel and STFT distances), perceptual quality (UTMOS), intelligibility (STOI), and Word Error Rate (WER).

Performance Gains

TFC demonstrates a significant advantage over CFR baselines. In a head-to-head comparison at a 3kbps bitrate, the DAC+TFC model (operating at an average of 37.5 Hz) achieved a UTMOS of 3.895, compared to the standard DAC baseline's 3.628.

Figure 2: Performance comparison between DAC+TFC and the DAC baseline across WER, Mel Distance, UTMOS, and STOI metrics.

As seen in Figure 2, TFC consistently outperforms the baseline across multiple metrics. Notably, at a 6kbps bitrate, TFC reduced the Word Error Rate from 4.125% to 2.845%, suggesting that the variable rate more effectively preserves phonetic information.

Seamless Tunability

One of the most powerful features of TFC is its tunability. Unlike traditional codecs that require separate models for different bitrates, TFC allows a single model to support any average frame rate between 18.75 Hz and 75 Hz. This is achieved simply by adjusting the granularity ratios at inference time, providing a flexible trade-off between sequence length and audio quality.

Conclusion and Future Work

Temporally Flexible Coding represents a significant step forward in neural speech compression. By moving beyond the constraints of constant frame rates, TFC reduces temporal redundancy and improves the efficiency of downstream generative tasks. While the current implementation uses a heuristic entropy-based allocation, future research could explore training a neural "router" to learn optimal frame rate allocation end-to-end.

Summary updated

BibTeX
@inproceedings{zhang2025unlocking,
  author = {Hanglei Zhang and Yiwei Guo and Zhihan Li and Xiang Hao and Xie Chen and Kai Yu},
  title = {{Unlocking Temporal Flexibility: Neural Speech Codec with Variable Frame Rate}},
  booktitle = {Interspeech},
  year = {2025},
  doi = {10.21437/interspeech.2025-1289},
}
Figure