OpenVoiceChat icon indicating copy to clipboard operation
OpenVoiceChat copied to clipboard

Refine Interruption Handling

Open thy-hoang-nn opened this issue 1 year ago • 1 comments

Hi, Thank you for your contribution to the voice-based conversational engine. I'm encountering an issue while reimplementing your code. Specifically, the bot is designed to operate in a streaming mode, but the problem arises when it starts speaking the first processed sentence, the recording then gets interrupted and it doesn’t continue with the rest of the response.. How can fix the issue ?

thy-hoang-nn avatar Aug 19 '24 10:08 thy-hoang-nn

Hmm, interruptions happen when the bot is speaking and the user says something in between. This stops the bot speaking (audio being played) and lets the user speak. If you're running main.py try adding the following and see if the error persists. The following line will disable interruptions.

    api_key = os.getenv('DEEPGRAM_API_KEY')
    # ear = Ear_deepgram(silence_seconds=2, api_key=api_key)
    ear = Ear_hf(silence_seconds=2, device=device)
   
    # ----The following line will disable interruption handling----
    ear.interrupt_listen = lambda x: ""

    load_dotenv()

    chatbot = Chatbot_gpt(sys_prompt=llama_sales)

p.s Also since the lib is in alpha rn, would recommend installing using pip install git+https://github.com/Finity-Alpha/OpenVoiceChat.git

fakhirali avatar Aug 19 '24 12:08 fakhirali

Thanks for your help

thy-hoang-nn avatar Oct 12 '24 07:10 thy-hoang-nn