DeepFilterNet icon indicating copy to clipboard operation
DeepFilterNet copied to clipboard

Using deepfilter in Python on streaming audio chunks

Open neeagl opened this issue 1 year ago • 11 comments

Will be great if someone can share pointers to be able to use DF to process continuous audio chunks coming from the microphone (or other sources)

Appreciate the help! Thanks

neeagl avatar Jan 29 '25 18:01 neeagl

https://gist.github.com/Safari77/a505d2e6474240554c1f0acb4379a31f https://raw.githubusercontent.com/spatialaudio/python-sounddevice/refs/tags/0.5.1/examples/plot_input.py python ./plot_input.py -d "DeepFilter Noise Cancelling Source Mono"

Safari77 avatar Jan 29 '25 19:01 Safari77

https://gist.github.com/Safari77/a505d2e6474240554c1f0acb4379a31f https://raw.githubusercontent.com/spatialaudio/python-sounddevice/refs/tags/0.5.1/examples/plot_input.py python ./plot_input.py -d "DeepFilter Noise Cancelling Source Mono"

@Safari77 Thanks for your quick revert. I'm looking for pure Python using native DF instead of the need to set up Pipewire. We'd need to deploy it to our app servers to process realtime audio feeds.

neeagl avatar Jan 29 '25 20:01 neeagl

I have tried using a similar implementation as this one: https://github.com/Sharrnah/whispering/blob/main/Models/STS/DeepFilterNet.py but unable to use it correctly.

neeagl avatar Jan 29 '25 20:01 neeagl

go to the git repo dir DeepFilterNet/pyDF and

python setup.py install --user
pip install deepfilternet

then start coding

from df.enhance import enhance, init_df, load_audio, save_audio

model, df_state, _ = init_df()

Safari77 avatar Jan 29 '25 20:01 Safari77

Thanks @Safari77. The shared snippet works as a batch job on the given audio file but what I'm looking here is the ability to process small chunks of audio in real-time (20ms each). Basically will be feeding in chunks from Twilio to remove the bg noise before further processing.

from df.enhance import enhance, init_df, load_audio, save_audio

model, df_state, _ = init_df()

neeagl avatar Jan 30 '25 07:01 neeagl

@neeagl I have the same request. Have you been able to make it work?

whatscoding avatar Feb 02 '25 14:02 whatscoding

@whatscoding unfortunately no. Still looking for options

neeagl avatar Feb 02 '25 15:02 neeagl

@whatscoding unfortunately no. Still looking for options did you find anything close to this ?

apostoloskotsiras avatar Apr 14 '25 10:04 apostoloskotsiras

@neeagl did you find a way out for this?

asr-aditya avatar Apr 24 '25 16:04 asr-aditya

@apostoloskotsiras @asr-aditya no coudln't work on this, tried using facebook denoiser but not able to devote time for a perfect implementation.

neeagl avatar Apr 24 '25 17:04 neeagl

@neeagl Hi, did you find a way out for this?

Francis235 avatar Jun 12 '25 14:06 Francis235

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Sep 11 '25 02:09 github-actions[bot]