cs.SDJun 3, 2026

nnAudio 2: Overcoming Dynamic Compilation Barriers and Transform Inconsistencies

Authors: Abhinaba RoyJunyi LiangDorien Herremans

Organizations: Singapore University of Technology and Design

Abstract

nnAudio is an open-source audio feature extraction toolbox for deep learning, but its use in current environments is hindered by TorchScript incompatibilities, inverse-transform edge cases, and dependency drift. We present a targeted modernization for modern PyTorch and scientific Python. We resolve TorchScript compilation failures in STFT and iSTFT by removing dynamic state mutation and module construction from scripted code paths and tightening argument handling in inverse-related helpers. We clarify inverse-STFT behavior by restricting reliable inversion to the uniform-bin setting (freq_scale=`no') and raising explicit runtime errors for unsupported frequency scales, preventing silently degraded reconstructions. We restore CFP compatibility with modern SciPy and ensure VQT reduces to CQT when gamma = 0. Regression tests cover the new STFT/iSTFT behaviors, and the updated codebase passes the full repository test suite in a modern Python environment. These improvements provide a more robust foundation for differentiable audio analysis in research and deployment.

Explore similar work

CardsList
  1. Attack-Dependent Robustness of Neural Audio Codecs for Adversarial ASR

    Mar 10, 2026Jordan Prescott, Thanathai Lertpetchpun, Shrikanth NarayananNeural Audio Codecs