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

dicord bot voice #633

Merged
merged 10 commits into from
Nov 28, 2024
Merged

dicord bot voice #633

merged 10 commits into from
Nov 28, 2024

Conversation

tcm390
Copy link
Collaborator

@tcm390 tcm390 commented Nov 27, 2024

related: #244

This PR aims to improve and fix the Discord bot's voice functionality and enhance the code structure for better usability.

Fix Regression in Discord Voice Channel
Fixed a regression issue that previously prevented users from speaking in the Discord voice channel.

Add shouldRespond Function
Added a shouldRespond function for the bot's voice feature to control when the bot should respond to user voice inputs.

Refactor Transcription Process
Refactored the transcription process by adding a debounce function, ensuring voice messages are processed only when silence is detected.

Enable Bot to Respond to Text Messages in Voice Channels
Updated the bot to handle text messages sent in voice channels.

Add Optional DISCORD_VOICE_CHANNEL_ID in .env
Introduced a new constant, DISCORD_VOICE_CHANNEL_ID, in the .env file to allow users to specify a voice channel the bot should join.

Implemented Audio Playback Interrupt Mechanism
Add a sliding window buffer that monitors the audio volume while the agent is speaking. If the average volume of the user's audio exceeds the defined threshold, it indicates active speaking. When active speaking is detected, stop the agent's current audio playback to avoid overlap.

@twilwa twilwa merged commit 367f9b4 into main Nov 28, 2024
0 of 3 checks passed
@twilwa twilwa deleted the tcm-dicord-bot-voice branch November 28, 2024 03:53
@twilwa twilwa restored the tcm-dicord-bot-voice branch November 28, 2024 03:54
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