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 interrupts #127

Merged
merged 3 commits into from
Apr 4, 2024
Merged

fix interrupts #127

merged 3 commits into from
Apr 4, 2024

Conversation

matthewkennedy5
Copy link
Contributor

@matthewkennedy5 matthewkennedy5 commented Apr 4, 2024

User description

The previous PR caused problems because it no longer interrupted the bot after start of speech was detected by VAD. This changes it to allow interruptions after start_of_speech is detected, if whisper detects no_speech_prob < 0.5.

Also, we only append to self.audio_data if start of speech has been detected. This should help with the spurious "Thank yous" that whisper hears on silence.


Description

  • Introduced a state tracking mechanism with self.speech_has_started to determine if the speech has started, which prevents appending audio data until speech is detected.
  • Removed logging for 'detected_start_of_speech' and 'detected_end_of_speech' events to streamline the audio handling process.

Changes walkthrough

Relevant files
Enhancement
response_agent.py
Implement Speech Start Detection for Audio Data Appending           

openduck-py/openduck_py/response_agent.py

  • Added a new boolean attribute self.speech_has_started to track the
    start of speech.
  • Modified receive_audio method to only append audio data if speech has
    started.
  • Removed unnecessary logging of start and end of speech events.
  • +7/-16   
    💡 Usage Guide

    Checking Your Pull Request

    Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

    Talking to CodeAnt AI

    Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

    @codeant-ai ask: Your question here
    

    This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

    Check Your Repository Health

    To analyze the health of your code repository, visit our dashboard at app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

    Copy link

    vercel bot commented Apr 4, 2024

    The latest updates on your projects. Learn more about Vercel for Git ↗︎

    Name Status Preview Comments Updated (UTC)
    openduck ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 4, 2024 5:50pm

    @codeant-ai codeant-ai bot added enhancement New feature or request bug_fix labels Apr 4, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    bug_fix enhancement New feature or request
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    None yet

    3 participants