# Azure Speech Recognition A Flutter plugin for Microsoft Azure Speech services, providing both speech recognition (ASR) and text-to-speech (TTS) capabilities. ## Features - Speech-to-text (Azure Speech Recognition) - Text-to-speech (Azure Speech Synthesis) - Support for multiple languages - Language detection - Continuous recognition - Streaming synthesis ## Getting Started ### Prerequisites - Azure Speech service subscription key - Azure Speech service region ### Installation Add this to your package's `pubspec.yaml` file: ```yaml dependencies: azure_speech_recognition: path: ./azure ``` ### Usage ```dart import 'package:azure_speech_recognition/azure_speech_recognition.dart'; // Initialize the service await AzureSpeechRecognition.initialize( subscriptionKey: 'your_subscription_key', region: 'your_region', supportedLanguages: ['zh-CN', 'en-US'], ); // Start continuous recognition await AzureSpeechRecognition.startContinuousRecognition(); // Listen for recognition events AzureSpeechRecognition.onRecognitionEvent.listen((event) { if (event['type'] == 'result') { print('Recognized: ${event['text']}'); print('Detected language: ${event['detectedLanguage']}'); } }); // Stop recognition when done await AzureSpeechRecognition.stopContinuousRecognition(); // Speak text await AzureSpeechRecognition.speakText('Hello, world!'); // Clean up await AzureSpeechRecognition.dispose(); ``` ## License This project is licensed under the MIT License - see the LICENSE file for details.