A modular voice assistant built with C#, Avalonia UI, and Azure AI services(Replaceable).
- Voice recognition with Azure Speech Services
- Natural language processing with Azure Language Understanding
- Text-to-speech capabilities
- Cross-platform UI with Avalonia
- Runs on macOS and Windows with platform-specific services
- Built-in commands for screenshots, folder opening and time queries
- Clean architecture design
- Go to the Azure Portal
- Create a new "Language Service" resource
- Select the appropriate subscription, resource group, and region
- Complete the resource creation process
- Go to Language Studio
- Sign in with your Azure account
- Create a new "Conversational Language Understanding" project
- Name your project "VoiceAssistant" (or update the config accordingly)
Create the following intents:
-
TakeScreenshot
- Add example utterances like:
- "Take a screenshot"
- "Capture my screen"
- "Take screenshot"
- "Screenshot please"
- Add example utterances like:
-
GetTime
- Add example utterances like:
- "What time is it"
- "Tell me the current time"
- "What's the time"
- "Current time please"
- Add example utterances like:
-
OpenFolder
- Add example utterances like:
- "Open folder Documents"
- "Browse to Downloads"
- "Show me the Pictures folder"
- Add an entity "FolderName" to extract the folder name from utterances
- Add example utterances like:
- Train your model
- Deploy it with the name "production" (or update the config accordingly)
Create the .env file with your Azure service keys:
- Open
.env.example - Create
.envbased on it (or simply rename) - Replace the placeholder values with your actual Azure keys and endpoints.
For local development, you can set useMockServices = true in Program.cs to use mock implementations instead of making actual Azure API calls.
The application follows a clean architecture approach:
- VoiceAssistant.Domain: Core entities and interfaces
- VoiceAssistant.Application: Application logic and use cases
- VoiceAssistant.Infrastructure: External services implementation
- VoiceAssistant.UI: User interface with Avalonia
This project is designed with extensibility in mind through the use of abstractions and dependency injection:
For example, to implement a different speech recognition service:
- Create a new class implementing
ISpeechRecognitionService - Register your implementation in the dependency injection container
- No other code changes required!
- Set up your Azure services as described above
- Create the .env with your API keys based on .env.example
- Build and run the application:
dotnet run --project VoiceAssistant.UIRun unit tests with:
dotnet test