Spaces:
Paused
Paused
Peter Michael Gits Claude commited on
Commit Β·
c2a55a5
1
Parent(s): 319399f
fix: Resolve syntax error in audio_handler.py v0.3.28
Browse files- Add missing except block for HTTP STT processing try statement
- Fix references to non-existent stt_client/tts_client objects
- Update service availability check for HTTP-based approach
- This resolves SyntaxError that prevented app startup
π€ Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- core/audio_handler.py +5 -2
- version.py +1 -1
core/audio_handler.py
CHANGED
|
@@ -267,6 +267,9 @@ class AudioHandler:
|
|
| 267 |
os.unlink(tmp_file.name)
|
| 268 |
except:
|
| 269 |
pass # Ignore cleanup errors
|
|
|
|
|
|
|
|
|
|
| 270 |
|
| 271 |
print(f"π€ HANDLER DEBUG: Invalid audio array format")
|
| 272 |
return "Invalid audio format"
|
|
@@ -280,8 +283,8 @@ class AudioHandler:
|
|
| 280 |
|
| 281 |
def is_audio_service_available(self) -> Tuple[bool, bool]:
|
| 282 |
"""Check if STT and TTS services are available."""
|
| 283 |
-
stt_available =
|
| 284 |
-
tts_available =
|
| 285 |
return stt_available, tts_available
|
| 286 |
|
| 287 |
def get_audio_status(self) -> dict:
|
|
|
|
| 267 |
os.unlink(tmp_file.name)
|
| 268 |
except:
|
| 269 |
pass # Ignore cleanup errors
|
| 270 |
+
except Exception as stt_error:
|
| 271 |
+
print(f"π€ HANDLER ERROR: HTTP STT processing failed: {stt_error}")
|
| 272 |
+
return self._simulate_stt_with_length(len(audio_array) / sample_rate)
|
| 273 |
|
| 274 |
print(f"π€ HANDLER DEBUG: Invalid audio array format")
|
| 275 |
return "Invalid audio format"
|
|
|
|
| 283 |
|
| 284 |
def is_audio_service_available(self) -> Tuple[bool, bool]:
|
| 285 |
"""Check if STT and TTS services are available."""
|
| 286 |
+
stt_available = not self.demo_mode # HTTP-based, no client objects
|
| 287 |
+
tts_available = not self.demo_mode # HTTP-based, no client objects
|
| 288 |
return stt_available, tts_available
|
| 289 |
|
| 290 |
def get_audio_status(self) -> dict:
|
version.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
Version information for ChatCal Voice-Enabled AI Assistant
|
| 3 |
"""
|
| 4 |
|
| 5 |
-
__version__ = "0.3.
|
| 6 |
__build_date__ = "2025-08-19T15:27:00"
|
| 7 |
__description__ = "Voice-Enabled ChatCal AI Assistant with Hugging Face deployment"
|
| 8 |
|
|
|
|
| 2 |
Version information for ChatCal Voice-Enabled AI Assistant
|
| 3 |
"""
|
| 4 |
|
| 5 |
+
__version__ = "0.3.28"
|
| 6 |
__build_date__ = "2025-08-19T15:27:00"
|
| 7 |
__description__ = "Voice-Enabled ChatCal AI Assistant with Hugging Face deployment"
|
| 8 |
|