yx_speech_to_text_flutter/CHANGELOG.md

100 lines
3.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.0.5] - 2026-01-17
### ⚡ Improved
- **初始化不卡 UI**:新增 `useRecognizerIsolate` 选项,将 sherpa_onnx recognizer 初始化/解码放到后台 isolate避免初始化期间 UI 卡顿、进度动画不刷新
- **RecordingButton 体验优化**:首次点击懒加载初始化时先让出一帧,确保加载动画能立即渲染
### 🐛 Fixed
- 修复 `RecordingButton` 中防抖延迟导致的测试 pending timers 问题(改为可取消 Timer 并在 dispose 清理)
- 修复测试环境下部分平台 API 不可用导致的失败(增加必要的 mock/容错)
## [1.0.4] - 2025-01-23
### 🎉 Added - 多实例会话管理支持
- **会话管理系统**:新增完整的会话管理功能,支持同一页面多个独立的录音会话
- **YxAsrService 新方法**
- `registerSession()` - 注册新会话
- `unregisterSession()` - 注销会话
- `startListeningForSession()` - 为特定会话开始录音
- `stopListeningForSession()` - 为特定会话停止录音
- `getResultStreamForSession()` - 获取特定会话的结果流
- `getStatusStreamForSession()` - 获取特定会话的状态流
- `getRegisteredSessions()` - 获取所有已注册的会话列表
- `getActiveSessionId()` - 获取当前活跃的会话ID
- **RecordingButton 新参数**
- `sessionId` - 会话ID参数用于标识不同的录音实例
- **智能会话切换**:自动管理会话切换,同一时间只有一个会话活跃
### 🐛 Fixed
- 修复同一页面多个 RecordingButton 状态同步问题
- 修复录音结果分发到错误按钮的问题
- 修复会话间状态互相干扰的问题
### ⚡ Improved
- 优化会话切换逻辑,无缝切换不同会话
- 改进资源管理,会话注销时自动清理资源
- 增强错误处理,会话级别的错误追踪
### 📝 Changed
- 保持完全向后兼容,现有代码无需修改
- 识别结果同时发送到全局流和会话流(双重分发机制)
### 🎯 Use Cases
此版本主要解决以下场景:
- ✅ 同一页面有多个录音输入框(如:问题反馈 + 本月总结)
- ✅ 多个 RecordingButton 需要独立工作,互不干扰
- ✅ 需要追踪特定录音按钮的状态和结果
### 💡 Breaking Changes
无破坏性更改,完全向后兼容。
### 📚 Documentation
- 新增会话管理API文档
- 更新使用示例,包含多实例场景
- 添加会话管理最佳实践指南
## [1.0.0] - 2025-08-26
### Added
- Initial release of YX ASR Flutter plugin
- Real-time speech-to-text recognition for iOS and Android
- Support for multiple languages and locales
- Customizable RecordingButton widget with visual feedback
- Comprehensive error handling and permission management
- Stream-based API for results, errors, and status changes
- On-device recognition support for iOS (iOS 13+)
- Partial results support for real-time transcription
- Example app demonstrating all features
- Comprehensive documentation and API reference
### Features
- Cross-platform support (iOS 11+ and Android API 21+)
- Minimal third-party dependencies
- Proper lifecycle management
- Permission handling for microphone access
- Multiple recognition alternatives
- Confidence scoring for recognition results
- Cancellation support
- Audio session management
### Platform Support
- **iOS**: Uses Speech framework with AVAudioEngine
- **Android**: Uses SpeechRecognizer API with proper lifecycle management
### Supported Languages
- English (en-US, en-GB)
- Chinese (zh-CN, zh-TW)
- Japanese (ja-JP)
- Korean (ko-KR)
- Spanish (es-ES)
- French (fr-FR)
- German (de-DE)
- Italian (it-IT)