Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jan 20, 2026

Summary

Adds a new crates/denoise crate that wraps DeepFilterNet libDF for audio noise suppression. The crate provides a clean Denoiser struct interface for processing audio frames at 48kHz with a 480-sample hop size.

Key implementation details:

  • Uses git dependency on DeepFilterNet v0.5.6 (newer versions have ndarray version conflicts with tract)
  • Provides process_frame() for single-frame processing and process() for batch processing
  • Returns error if input length is not a multiple of hop_size (no silent data loss)
  • All 6 unit tests passing

Updates since last revision

  • Added default-model-ll feature flag for low-latency model (reduced algorithmic latency for real-time use)
  • Fixed silent data loss - process() now returns InvalidFrameSize error instead of silently truncating
  • Added benchmark suite using real audio data from hypr-data crate
  • Fixed formatting issues (dependency ordering, assert_eq! formatting)

Benchmark results (48kHz audio):

Model Throughput Time for 1h audio
default-model 3.45 Msamples/s ~50 seconds
default-model-ll 1.84 Msamples/s ~94 seconds

Note: "Low-latency" refers to reduced algorithmic lookahead, not faster processing. Use default-model for batch processing.

Review & Testing Checklist for Human

  • Verify dependency footprint is acceptable - This adds significant dependencies (tract-core, tract-onnx, tract-hir, tract-pulse, etc.) which may impact build times and binary size
  • Test with actual noisy audio - Verify denoising quality with real noisy audio samples beyond the test data
  • Confirm v0.5.6 pinning is acceptable - Newer DeepFilterNet versions have ndarray version conflicts; this older version was required to compile
  • Review if 48kHz fixed sample rate works for your use case - Audio at other sample rates would need external resampling
  • Verify error handling behavior - process() now returns error for non-multiple of hop_size inputs instead of silent truncation

Suggested test plan:

  1. Run cargo test -p denoise to verify unit tests pass
  2. Run cargo bench -p denoise to verify benchmark runs
  3. Test with actual noisy audio file to verify denoising quality

Notes

This crate is not yet integrated into the audio pipeline - it's just the foundation crate. Integration with listener/audio processing would be a follow-up.

Requested by @yujonglee

Link to Devin run: https://app.devin.ai/sessions/6128c661afaa4d9ca4bbf3b90071483a

- Create new denoise crate that wraps DeepFilterNet libDF for audio denoising
- Uses git dependency on DeepFilterNet v0.5.6 tag
- Provides clean interface with Denoiser struct for processing audio frames
- Supports 48kHz sample rate with 480 sample hop size
- Includes process_frame() for single frame and process() for batch processing
- All tests passing

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link

netlify bot commented Jan 20, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit 4b78c7c
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/696f6e40922ed80008ffc0d9

@netlify
Copy link

netlify bot commented Jan 20, 2026

Deploy Preview for howto-fix-macos-audio-selection canceled.

Name Link
🔨 Latest commit 4b78c7c
🔍 Latest deploy log https://app.netlify.com/projects/howto-fix-macos-audio-selection/deploys/696f6e404c5def000836be2d

@netlify
Copy link

netlify bot commented Jan 20, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit 4b78c7c
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/696f6e40c92b730008428e52

Copy link
Contributor Author

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View issue and 3 additional flags in Devin Review.

Open in Devin Review

devin-ai-integration bot and others added 4 commits January 20, 2026 11:31
- Return error when input length is not a multiple of hop_size
- Add test for invalid length error case
- Add benchmark suite following aec crate pattern
- Benchmarks: initialization, process_frame, process (10/100/1000 frames), throughput

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
- Load 48kHz audio from english_1 test data
- Benchmark with actual audio samples instead of zero-filled buffers
- Results: ~284µs per frame, ~3.45 Msamples/s throughput

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
- Add default-model-ll feature flag for DeepFilterNet3 low-latency model
- Update cfg attributes to support both default-model and default-model-ll
- Benchmark comparison shows default model is faster for batch processing:
  - Default: 3.45 Msamples/s, ~50s for 1h audio
  - Low-latency: 1.84 Msamples/s, ~94s for 1h audio
- Low-latency model has reduced algorithmic latency for real-time use

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it.

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.

2 participants