try to fix conversational awareness volume restore

This commit is contained in:
Kavish Devar
2024-12-02 23:35:27 +05:30
parent 71dffd1415
commit c6af6a147f
3 changed files with 300 additions and 2 deletions

View File

@@ -190,8 +190,10 @@ def handle_conversational_awareness(status):
new_volume = max(0, min(int(initial_volume * 0.5), 100)) # Set volume to 50%
elif status >= 8:
new_volume = initial_volume # Fully restore volume
set_volume(new_volume)
try:
set_volume(new_volume)
except Exception as e:
logging.error(f"Error setting volume: {e}")
logging.getLogger("Conversational Awareness").info(f"Volume set to {new_volume}% based on conversational awareness status: {status}")
# If status is 9, print conversation end message