speechrecognizer 0.0.1
speechrecognizer: ^0.0.1 copied to clipboard
Flutter 语音识别插件,支持 HarmonyOS/OpenHarmony,基于系统 CoreSpeechKit 实现实时语音转文字与麦克风权限管理。
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.0.1 - 2026-02-08 #
Added #
- HarmonyOS/OpenHarmony 支持
- 基于
@kit.CoreSpeechKit的语音识别能力 - MethodChannel 通信(channel 名称:
speechrecognizer)
- 基于
- 权限
requestPermission():请求麦克风权限(ohos.permission.MICROPHONE)- 原生端实现
AbilityAware,使用UIAbilityContext进行动态授权
- 语音识别
startSpeechRecognition():开始语音识别(支持language、sessionId、recognitionMode、audioInfo参数)stopSpeechRecognition():停止语音识别getLastSpeechRecognitionResult():获取最后一次识别结果
- 事件回调
setListeners()/removeListeners():设置/移除监听onStart:识别开始onResult:识别结果(可多次触发)onComplete:识别完成onError:识别出错
- 数据模型
SpeechRecognitionResult、SpeechRecognitionStartResult、SpeechRecognitionCompleteResult、SpeechRecognitionError、SpeechAudioInfo
- 示例应用
- example 中完整演示:权限请求、开始/停止识别、实时结果展示与日志
- 文档与配置
- README:安装、权限、API、数据类型说明
- 插件 HAR 与 entry 的
module.json5中声明麦克风权限及reason/usedScene - LICENSE:MIT,版权坚果派
Platform #
- ohos:支持(仅麦克风模式
recognitionMode = 0) - android:未实现
- ios:未实现