Summary
EdgeTtsWebSocketServer is broken because it references non-existent VoiceAssistant.Data.EntityFrameworkCore project with SQLite database. This causes all TTS requests to fail with 0 bytes audio output.
We no longer use SQLite anywhere - the entire system uses PostgreSQL now.
Current Problem
Symptoms
When TTS request hits EdgeTTS-HTTP server (port 5555):
- Server tries to check
SpeechLockExistsQuery via SQLite
- SQLite connection fails (database doesn't exist)
- Server continues but WebSocket to Microsoft returns 0 bytes
- Circuit breaker trips → fallback to VoiceRSS/PiperTTS (wrong voice)
Error from logs
Microsoft.Data.Sqlite.SqliteException
at VoiceAssistant.Data.EntityFrameworkCore.QueryHandlers.SpeechLockQueryHandlers.SpeechLockExistsQueryHandler.GetResultToHandleAsync
at EdgeTtsWebSocketServer.Services.EdgeTtsService.IsSpeechLockedAsync()
Connected to Microsoft Edge TTS WebSocket
WebSocket closed by server
Total audio data collected: 0 bytes
Root Cause
EdgeTtsWebSocketServer.csproj references:
<ProjectReference Include="..\Data.EntityFrameworkCore\Data.EntityFrameworkCore.csproj" />
This project (VoiceAssistant.Data.EntityFrameworkCore) was the old SQLite-based data layer that no longer exists. The system now uses PostgreSQL via VirtualAssistant.Data.EntityFrameworkCore.
Affected Files
EdgeTtsService.cs
Contains IsSpeechLockedAsync(), ShouldBlockSpeechAsync(), IsCapsLockOn() - all this speech blocking logic needs to be removed.
AssistantSpeechStateService.cs
Uses VoiceAssistantDbContext (the old SQLite one) for tracking assistant speech state. Delete entire file.
Program.cs (line 10)
builder.Services.AddVoiceAssistantData(builder.Configuration);
Registers the old SQLite-based data services.
Required Fix
Remove ALL SpeechLock, CapsLock, and database dependencies completely:
-
Remove project reference from EdgeTtsWebSocketServer.csproj:
<!-- DELETE THIS LINE -->
<ProjectReference Include="..\Data.EntityFrameworkCore\Data.EntityFrameworkCore.csproj" />
-
Delete AssistantSpeechStateService.cs entirely
-
In EdgeTtsService.cs remove:
IsSpeechLockedAsync() method
IsCapsLockOn() method
ShouldBlockSpeechAsync() method
- All calls to these methods
_assistantSpeechState field and its usage
- Constructor parameter
AssistantSpeechStateService assistantSpeechState
-
Update Program.cs:
- Remove
builder.Services.AddVoiceAssistantData(builder.Configuration);
- Remove
builder.Services.AddSingleton<AssistantSpeechStateService>();
-
Remove unused usings:
Olbrasoft.Mediation
Olbrasoft.VoiceAssistant.Shared.Data.Queries.SpeechLockQueries
Olbrasoft.VoiceAssistant.Data.EntityFrameworkCore
-
In SpeakAsync() method - remove the speech lock check at the beginning:
// DELETE THIS BLOCK:
if (await ShouldBlockSpeechAsync())
{
_logger.LogInformation("Speech blocked - skipping TTS for: {Text}", text);
return (true, string.Empty, false);
}
-
In PlayAudioAsync() method - remove:
await _assistantSpeechState.StartSpeakingAsync();
await _assistantSpeechState.StopSpeakingAsync();
- The polling loop that checks
IsCapsLockOn() during playback
Testing
After fix:
- Restart edge-tts-server service:
systemctl --user restart edge-tts-server.service
- Reset circuit breakers:
curl -X POST http://localhost:5055/api/tts/reset-circuit-breaker
- Test TTS:
curl -X POST http://localhost:5055/api/tts/speak -H "Content-Type: application/json" -d '{"text": "Test"}'
- Verify logs show
TTS generated by 'EdgeTTS-HTTP' (not VoiceRSS or PiperTTS)
Additional Context
Python edge-tts works fine
edge-tts --voice cs-CZ-AntoninNeural --text "Test" --write-media /tmp/test.mp3
# Creates 11KB file successfully
This proves Microsoft Edge TTS service is working. The problem is our C# server's broken dependencies.
Acceptance Criteria
Summary
EdgeTtsWebSocketServer is broken because it references non-existent
VoiceAssistant.Data.EntityFrameworkCoreproject with SQLite database. This causes all TTS requests to fail with 0 bytes audio output.We no longer use SQLite anywhere - the entire system uses PostgreSQL now.
Current Problem
Symptoms
When TTS request hits EdgeTTS-HTTP server (port 5555):
SpeechLockExistsQueryvia SQLiteError from logs
Root Cause
EdgeTtsWebSocketServer.csprojreferences:This project (
VoiceAssistant.Data.EntityFrameworkCore) was the old SQLite-based data layer that no longer exists. The system now uses PostgreSQL viaVirtualAssistant.Data.EntityFrameworkCore.Affected Files
EdgeTtsService.cs
Contains
IsSpeechLockedAsync(),ShouldBlockSpeechAsync(),IsCapsLockOn()- all this speech blocking logic needs to be removed.AssistantSpeechStateService.cs
Uses
VoiceAssistantDbContext(the old SQLite one) for tracking assistant speech state. Delete entire file.Program.cs (line 10)
Registers the old SQLite-based data services.
Required Fix
Remove ALL SpeechLock, CapsLock, and database dependencies completely:
Remove project reference from
EdgeTtsWebSocketServer.csproj:Delete
AssistantSpeechStateService.csentirelyIn
EdgeTtsService.csremove:IsSpeechLockedAsync()methodIsCapsLockOn()methodShouldBlockSpeechAsync()method_assistantSpeechStatefield and its usageAssistantSpeechStateService assistantSpeechStateUpdate
Program.cs:builder.Services.AddVoiceAssistantData(builder.Configuration);builder.Services.AddSingleton<AssistantSpeechStateService>();Remove unused usings:
Olbrasoft.MediationOlbrasoft.VoiceAssistant.Shared.Data.Queries.SpeechLockQueriesOlbrasoft.VoiceAssistant.Data.EntityFrameworkCoreIn
SpeakAsync()method - remove the speech lock check at the beginning:In
PlayAudioAsync()method - remove:await _assistantSpeechState.StartSpeakingAsync();await _assistantSpeechState.StopSpeakingAsync();IsCapsLockOn()during playbackTesting
After fix:
systemctl --user restart edge-tts-server.servicecurl -X POST http://localhost:5055/api/tts/reset-circuit-breakercurl -X POST http://localhost:5055/api/tts/speak -H "Content-Type: application/json" -d '{"text": "Test"}'TTS generated by 'EdgeTTS-HTTP'(not VoiceRSS or PiperTTS)Additional Context
Python edge-tts works fine
This proves Microsoft Edge TTS service is working. The problem is our C# server's broken dependencies.
Acceptance Criteria
SpeechLockExistsQuerycalls anywhere in the projectIsCapsLockOn()methodShouldBlockSpeechAsync()methodAssistantSpeechStateService.csdeleted