Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using deepfilter in Python on streaming audio chunks #626

Open
neeagl opened this issue Jan 29, 2025 · 7 comments
Open

Using deepfilter in Python on streaming audio chunks #626

neeagl opened this issue Jan 29, 2025 · 7 comments

Comments

@neeagl
Copy link

neeagl commented Jan 29, 2025

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

@Safari77
Copy link

@neeagl
Copy link
Author

neeagl commented Jan 29, 2025

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
Copy link
Author

neeagl commented Jan 29, 2025

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.

@Safari77
Copy link

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()

@neeagl
Copy link
Author

neeagl commented Jan 30, 2025

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()

@whatscoding
Copy link

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

@neeagl
Copy link
Author

neeagl commented Feb 2, 2025

@whatscoding unfortunately no. Still looking for options

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

No branches or pull requests

3 participants