-
Notifications
You must be signed in to change notification settings - Fork 1
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
Sound effects #67
base: main
Are you sure you want to change the base?
Sound effects #67
Conversation
@CodeAnt-AI ask: sure let's try this, how would you approach play_sfx_loop? |
Question: sure let's try this, how would you approach play_sfx_loop? Answer: To approach the
Here's a revised version of the async def play_sfx_loop(self, name):
sound = sound_effects[name]
loop_event = asyncio.Event() # Create an event to control the loop
try:
while not loop_event.is_set(): # Continue looping until the event is set
for i in range(0, len(sound), CHUNK_SIZE):
chunk = sound[i : i + CHUNK_SIZE]
await self.response_queue.put(chunk) # Put the chunk in the queue
await asyncio.sleep(len(chunk) / OUTPUT_SAMPLE_RATE) # Sleep for the duration of the chunk
except asyncio.CancelledError:
pass
finally:
loop_event.set() # Ensure the event is set when exiting the loop
# This function should be called with something like:
# self.hold_sound_task = asyncio.create_task(self.play_sfx_loop("generating")) Additionally, you would need a way to set the Remember to handle the cancellation of |
User description
Placeholder sounds made with the online editor Beepbox (project; cut every 2 seconds, then normalized to -1 dB, then monofied).
⚠ The sounds can get backlogged, need to figure out how to play them truly asynchronously (some sort of mixer? preemptible like
send_audio_loop
?).Description
librosa
, converted to the correct sample rate, and played at appropriate times during voice processing.SFX_VOLUME
to control the volume of sound effects.daily_bot.py
by removing an unnecessary blank line.Changes walkthrough
daily_bot.py
Minor Cleanup in PyAudioApp Class
clients/daily/daily_bot.py
voice.py
Implement Sound Effects for Voice Interaction
openduck-py/openduck_py/routers/voice.py
librosa
library for audio processing.play_sfx
method to play sound effects.play_sfx_loop
method with a TODO note for futureimplementation.
the assistant's response.
__init__.py
Add Sound Effects Volume Setting
openduck-py/openduck_py/settings/init.py
SFX_VOLUME
for sound effects volume control.docker-compose.yml
Update Docker Compose S3 Sync Path
docker-compose.yml
instead of 'styletts2'.
💡 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:
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.