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

fix: real time gui not work #123

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

RoversCode
Copy link

This PR addresses two issues and adds a pitch-shifting feature:

  1. Fixed the issue where infer_wav_res produces meaningless noise
    The real-time self.resampler conversion was corrupting the audio output. While the root cause is still under investigation, librosa resampling has been implemented as a working solution.
    2 . Fixed the silent output issue
    When block time is too large, the vad chunk size becomes excessive, causing infinite loops in 'if not self.vad_speech_detected' condition, resulting in silent output.
  2. Added pitch-shifting functionality
    Implemented pitch up/down features for input audio.

@Plachtaa
Copy link
Owner

Plachtaa commented Feb 11, 2025

Hi there, thanks for your hard work!
For 1. , I question your opinion on "The real-time self.resampler conversion was corrupting the audio output", reason for producing meaning less noise is most likely to be the case in #125 , please let me know if this is not your case.
For 2. , This is a good bonus feature, but I cannot run your script as there are multiple model checkpoint loading issues. If you agree, I will make some changes on your script before merging your PR.

Thanks

@RoversCode
Copy link
Author

Thank you for your feedback!

Regarding point 1, through debugging, I've located that the issue is indeed with self.resampler - it converts valid speech signals into silence. I believe issue #125 is likely caused by the same problem, as I observe intermittent audio anomalies in real-time speech output even without making any modifications.

Regarding point 2, feel free to modify the code as needed, since I only added this feature in a simple way without much consideration for code optimization and performance.

I mainly wanted to report these two bugs. Specifically about the self.resampler issue, I'm also puzzled about the root cause. I've reviewed the code and found it's just using the basic torchaudio.transforms.Resample implementation. While strange, I can confirm the problem is definitely with this component

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