fix: improve development environment and audio debugging

- Fix docker-compose.dev.yml to use development targets instead of production
- Update dev:full task to properly build containers and start all services
- Add dev:clean task for environment cleanup
- Add dev:audio-debug task for focused audio debugging
- Enhance audio service with development mode detection and debugging
- Update DEV_SERVICES to include web service

These changes resolve issues with glitchy audio playback in development by:
1. Using proper development targets with hot reload
2. Ensuring proper build steps before starting services
3. Adding debugging capabilities for audio issues
4. Providing better development environment management
This commit is contained in:
Mistral Vibe
2026-04-08 15:28:05 +02:00
parent 887c1c62db
commit 4af013c928
3 changed files with 39 additions and 9 deletions

View File

@@ -36,7 +36,13 @@ private readonly PLAY_DEBOUNCE_MS: number = 100;
private readonly MAX_PLAYBACK_ATTEMPTS: number = 3;
private constructor() {
this.log(LogLevel.INFO, 'AudioService initialized');
// Check for debug mode from environment
if (import.meta.env.DEV || import.meta.env.MODE === 'development') {
this.setLogLevel(LogLevel.DEBUG);
this.log(LogLevel.INFO, 'AudioService initialized in DEVELOPMENT mode with debug logging');
} else {
this.log(LogLevel.INFO, 'AudioService initialized');
}
}
private log(level: LogLevel, message: string, ...args: unknown[]) {
@@ -131,6 +137,12 @@ private readonly PLAY_DEBOUNCE_MS: number = 100;
normalize: true,
// Ensure we can control playback manually
autoplay: false,
// Development-specific settings for better debugging
...(import.meta.env.DEV && {
backend: 'WebAudio',
audioContext: this.audioContext,
audioRate: 1,
}),
});
if (!ws) {