Skip to content

Fix audio resampling: use librosa.resample instead of np.interp#386

Open
hobostay wants to merge 1 commit into
microsoft:mainfrom
hobostay:fix/audio-resampling
Open

Fix audio resampling: use librosa.resample instead of np.interp#386
hobostay wants to merge 1 commit into
microsoft:mainfrom
hobostay:fix/audio-resampling

Conversation

@hobostay
Copy link
Copy Markdown

@hobostay hobostay commented May 4, 2026

Summary

  • Replace np.interp (linear waveform interpolation) with librosa.resample for audio resampling in demo/vibevoice_asr_inference_from_file.py
  • np.interp is not a valid resampling method — it introduces aliasing artifacts by not applying an anti-aliasing filter before decimation/interpolation
  • librosa.resample uses proper band-limited sinc interpolation

Details

Affected file: demo/vibevoice_asr_inference_from_file.py (lines 325-332)

The original code used np.interp to downsample audio waveforms by linearly interpolating sample values. This approach does not include an anti-aliasing filter, so high-frequency components fold back into the audible range as artifacts. librosa.resample is already used elsewhere in this project (vibevoice_tokenizer_processor.py, vibevoice_asr_processor.py).

Test plan

  • Run the ASR inference demo with audio files that require resampling
  • Verify the transcription quality is preserved or improved

🤖 Generated with Claude Code

np.interp performs linear interpolation on the waveform samples,
which is not a valid resampling method. It introduces aliasing
artifacts by not applying an anti-aliasing filter before
decimation/interpolation.

Replace with librosa.resample which uses proper band-limited
sinc interpolation. librosa is already a dependency used elsewhere
in the project (vibevoice_tokenizer_processor.py,
vibevoice_asr_processor.py).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant